shizhongqi 4 bulan lalu
induk
melakukan
f6de5c79d8

+ 47 - 0
任务小笔记/26年/03-09:红包规则更新.md

@@ -0,0 +1,47 @@
+### 改成使用阶梯式红包
+充值金额前期只设置一项,充值金额对应赠送的红包可以多个
+![[Pasted image 20260316092847.png|320x670]]
+
+### 表变动
+- xhHb 表未变动
+
+- 充值赠送红包表 xhRechargeShb 变动了,从:
+```
+CREATE TABLE `xhRechargeShb` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `sjId` int(11) NOT NULL DEFAULT '0' COMMENT '商家id',
+  `shopId` int(11) NOT NULL DEFAULT '0' COMMENT '门店id',
+  `mainId` int(11) NOT NULL DEFAULT '0' COMMENT '中央id',
+  `amount` decimal(9,2) NOT NULL DEFAULT '0.00' COMMENT '充值金额',
+  `hbAmount` decimal(9,2) NOT NULL DEFAULT '0.00' COMMENT '红包金额',
+  `num` int(11) NOT NULL DEFAULT '1' COMMENT '红包数量',
+  `miniCost` int(11) NOT NULL DEFAULT '0' COMMENT '最低消费金额,0表示没有要求',
+  `duration` smallint(6) NOT NULL DEFAULT '0' COMMENT '时长,天数,0永不过期',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='充值赠送红包';
+```
+变更为:
+```
+CREATE TABLE `xhRechargeShb` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `sjId` int(11) NOT NULL DEFAULT '0' COMMENT '商家id',
+  `shopId` int(11) NOT NULL DEFAULT '0' COMMENT '门店id',
+  `mainId` int(11) NOT NULL DEFAULT '0' COMMENT '中央id',
+  `amount` decimal(9,2) NOT NULL DEFAULT '0.00' COMMENT '充值金额',
+  `allHbAmount` decimal(9,2) NOT NULL DEFAULT '0.00' COMMENT '赠送红包总额',
+  `num` int(11) NOT NULL DEFAULT '1' COMMENT '红包数量',
+  `rules` varchar(1000) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '''''' COMMENT '红包规则json,格式:[{"hbAmount": 100, "miniCost":30,"duration":0},{...}]',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='充值赠送红包';
+```
+红包规则json,格式:[{"hbAmount": 100, "miniCost":30,"duration":0},{...}] 其中:
+
+| 字段名           | 说明 |
+| ------------- | --------------------- |
+| hbAmount      | 红包金额                  
+| hbNum         | 红包数量                 
+| miniCost      | 最低多少,红包才可用         
+| duration      | 过期时间(时间戳),0表示永不过期     
+| effectiveType | 生效时间的类型:1指定日期 2指定天数 
+| effectiveDate | 指定日期,记录指定的日期    
+| effectiveDays | 指定天数,记录指定了几天,0 表示立即生效

+ 12 - 0
任务小笔记/26年/03-13:预售自动结束.md

@@ -1,3 +1,5 @@
+### 脚本
+`/usr/local/nginx/html/huahuibao/yii product/cancel-presell`
 ### 表
 ```
 # xhGhsItem -- 花材表
@@ -7,3 +9,13 @@
 
 ```
 
+### 创建关于  presell 相关的索引
+```
+ALTER TABLE xhGhsItem  
+ADD INDEX idx_presell_addTime (presell, addTime);
+```
+查询语句:
+```
+SELECT * FROM xhGhsItem WHERE presell = 1 ORDER BY addTime DESC  
+LIMIT 20;
+```

TEMPAT SAMPAH
任务小笔记/26年/images/Pasted image 20260316092847.png