17 Commits

Author SHA1 Message Date
f801507961 feat: discount promo code marketing dropdown filter by current org 2026-07-13 16:39:04 +08:00
6c8d23b986 refactor: resellerid → auto from get_userorgid(), remove from codes 2026-07-09 13:39:10 +08:00
0256583cc1 fix: discount_promo_code sale_id改为nullable避免CRUD自动生成add报500 2026-07-05 10:32:11 +08:00
53eaa966ae feat: 客户归属支持多分销商 + 阶梯折扣表
discount_customer_bind:
- UNIQUE(customerid) → UNIQUE(customerid, resellerid)
  一个客户可绑定多个分销商
- bind_type: 加 3=域名注册
- 索引重命名: idx_dcb_customer → idx_dcb_customer_reseller

reseller_discount_tier (新增):
- 分销商阶梯折扣: name, min_amount, max_amount, discount_pct
- 按累计消费自动匹配档位
2026-06-30 15:45:15 +08:00
Hermes Agent
8d71c4f1d9 feat: productid联动过滤,cond条件category_id=[[prodtypeid]] 2026-06-24 09:30:08 +08:00
Hermes Agent
82522d8382 fix: codes移除dbname,修正表名和字段名
- prodtypeid→product_category(name)
- productid→product(product_name)
- 所有表在同一数据库,不需要dbname
2026-06-24 09:24:58 +08:00
Hermes Agent
d149f5d475 fix: codes指向正确的表名和字段名
- prodtypeid: prodtype→product_category(db=product_management)
- productid: textfield name→product_name(db=product_management)
- 添加dbname支持跨库JOIN
2026-06-24 09:16:43 +08:00
Hermes Agent
842647da89 refactor: 让CRUD自动处理code字段,移除手动alters配置 2026-06-24 09:10:43 +08:00
Hermes Agent
1ba7e0e031 feat: 调整discount表结构
- 删除discount字段(折扣值在detail子表中)
- customerid标题说明*表示全部客户
- init/data.json添加organization表的*记录(全部客户选项)
2026-06-24 01:33:46 +08:00
Hermes Agent
8040238ea5 fix: 移除timestamp字段的显式default声明
DDL生成器会自动为timestamp类型添加DEFAULT CURRENT_TIMESTAMP,
显式指定会导致重复DEFAULT声明,MySQL报错1067。

修复的表:
- discount_marketing (created_at, updated_at)
- discount_promo_code (created_at)
- discount_customer_bind (created_at)
2026-06-24 01:03:35 +08:00
Hermes Agent
f5250fb261 feat: 营销方案、促销码、客户归属绑定功能
- 新增3个数据模型: discount_marketing, discount_promo_code, discount_customer_bind
- 新增CRUD定义: marketing/promo_code/customer_bind 的list和api
- 新增init/data.json: appcodes编码(促销码类型、绑定方式)
- init.py: bind_customer支持customerid参数覆盖(注册场景)
- 折扣校验放宽至 0 < discount <= 1
2026-06-24 00:56:32 +08:00
a8cb13446e refactor(models): convert to json format per database-table-definition-spec 2026-05-27 13:23:25 +08:00
3a57205337 fix(discount): 兼容discount_detail表不存在的情况,fallback到discount.discount字段 + 新增discount_detail表定义和迁移脚本 + 修复discount.json中float类型缺少dec字段 2026-05-24 22:31:42 +08:00
b41c89e9dd bugfix 2026-05-11 11:30:57 +08:00
c890fdf249 bugfix 2026-02-25 12:05:48 +08:00
cdf20b7aee bugfix 2026-02-25 12:01:14 +08:00
45333b6b23 bugfix 2026-02-24 17:32:46 +08:00