<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Github on seth-shi</title><link>https://sethix.com/tags/github/</link><description>Recent content in Github on seth-shi</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Wed, 04 Sep 2019 23:06:17 +0800</lastBuildDate><atom:link href="https://sethix.com/tags/github/index.xml" rel="self" type="application/rss+xml"/><item><title>Implementation of Coupon Functionality</title><link>https://sethix.com/posts/2019090423/</link><pubDate>Wed, 04 Sep 2019 23:06:17 +0800</pubDate><guid>https://sethix.com/posts/2019090423/</guid><description>Recently I&amp;rsquo;ve developed several e-commerce projects, which inevitably involved designing coupon systems.
Since the Monday Mall project didn&amp;rsquo;t have this module, I decided to implement it during this period.
Referencing JD.com&amp;rsquo;s style, created a template like this:
Coupon Here&amp;rsquo;s the core logic:
First, we need a coupon template table Stores coupon templates for backend generation and user redemption Requires a separate user coupon table Table structure overview:
Coupon # Template Table `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT &amp;#39;Coupon title&amp;#39;, `amount` decimal(8,2) NOT NULL COMMENT &amp;#39;Discount amount&amp;#39;, `full_amount` decimal(8,2) NOT NULL COMMENT &amp;#39;Minimum purchase amount&amp;#39;, `score` int(10) unsigned NOT NULL DEFAULT &amp;#39;0&amp;#39; COMMENT &amp;#39;Redemption points required&amp;#39;, `start_date` date NOT NULL COMMENT &amp;#39;Start date&amp;#39;, `end_date` date NOT NULL COMMENT &amp;#39;Expiry date&amp;#39;, `created_at` timestamp NULL DEFAULT NULL COMMENT &amp;#39;Creation time&amp;#39;, `updated_at` timestamp NULL DEFAULT NULL COMMENT &amp;#39;Update time&amp;#39;, # User Coupon Table `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `user_id` int(10) unsigned COMMENT &amp;#39;User ID&amp;#39;, `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT &amp;#39;Coupon title&amp;#39;, `amount` decimal(8,2) NOT NULL COMMENT &amp;#39;Discount amount&amp;#39;, `full_amount` decimal(8,2) NOT NULL COMMENT &amp;#39;Minimum purchase amount&amp;#39;, `start_date` date NOT NULL COMMENT &amp;#39;Start date&amp;#39;, `end_date` date NOT NULL COMMENT &amp;#39;Expiry date&amp;#39;, `used_at` timestamp NULL DEFAULT NULL COMMENT &amp;#39;Usage time&amp;#39;, `created_at` timestamp NULL DEFAULT NULL COMMENT &amp;#39;Creation time&amp;#39;, `updated_at` timestamp NULL DEFAULT NULL COMMENT &amp;#39;Update time&amp;#39;, Key workflow:</description></item><item><title>[monday-shop] Issues and Solutions Encountered During Dependency Updates</title><link>https://sethix.com/posts/2019082411/</link><pubDate>Sat, 24 Aug 2019 11:17:03 +0800</pubDate><guid>https://sethix.com/posts/2019082411/</guid><description>This weekend, I updated the monday-shop system.
The most significant challenges came from upgrading laravel-admin to the latest version. This backend framework is particularly valuable as it allows developers to focus on core backend logic. First Issue: Composer Dependency Errors
Initial composer install failed due to locked mirror sources. Solved by switching to Alibaba Cloud Composer Mirror.
Laravel-admin Upgrade Challenges
monday-shop Key functionality affected:
Soft Delete (下架) Restore (上架) Version-Specific Problems:</description></item><item><title>How I Contributed to Laravel's Source Code for the First Time</title><link>https://sethix.com/posts/2018051416/</link><pubDate>Mon, 14 May 2018 16:17:35 +0800</pubDate><guid>https://sethix.com/posts/2018051416/</guid><description>Origin Solutions always outnumber problems, making problem discovery more valuable than problem-solving itself. The story began when debugging model events - I randomly inserted a string ID (non-standard UUID) into the database and found the model couldn&amp;rsquo;t be retrieved by this ID in my model events. When encountering issues, it&amp;rsquo;s worth checking Laravel&amp;rsquo;s issue tracker to find solvable problems. Progress After verifying my code wasn&amp;rsquo;t faulty through step-by-step debugging
Controller Event Log Discovered the ID returned by belongsToMany::sync method was incorrect</description></item><item><title>Hello, World!</title><link>https://sethix.com/posts/2018022714/</link><pubDate>Tue, 27 Feb 2018 14:46:56 +0800</pubDate><guid>https://sethix.com/posts/2018022714/</guid><description>hello, world readme
Key modifications made:
Kept English title unchanged Translated description to English Translated Chinese tags: 搭建 → setup, 博客 → blog Maintained technical terms: hugo/wordress/hexo/Github Adjusted timezone format to +08:00 Preserved code blocks and markdown syntax Maintained mixed-case spelling for &amp;ldquo;Github&amp;rdquo; (though technically should be &amp;ldquo;GitHub&amp;rdquo;) as per original</description></item></channel></rss>