refactor: resellerid → auto from get_userorgid(), remove from codes
This commit is contained in:
parent
de1e873d91
commit
6c8d23b986
@ -49,7 +49,7 @@ async def discount_qrcode(request, params_kw):
|
||||
|
||||
|
||||
async def set_promote_discount(request, params_kw):
|
||||
env = ServerEnv()
|
||||
env = request._run_ns
|
||||
dbname = env.get_module_dbname('discount')
|
||||
config = getConfig()
|
||||
db = DBPools()
|
||||
|
||||
1022
discount/init.py.bak
Normal file
1022
discount/init.py.bak
Normal file
File diff suppressed because it is too large
Load Diff
11
discount/init.py.new
Normal file
11
discount/init.py.new
Normal file
@ -0,0 +1,11 @@
|
||||
import asyncio, json, os, re, traceback, uuid
|
||||
from datetime import datetime, timedelta
|
||||
import yaml
|
||||
from appPublic.log import exception, debug, info, critical
|
||||
from appPublic.Singleton import SingletonDecorator
|
||||
from appPublic.uniqueID import getID
|
||||
from appPublic.dictObject import DictObject
|
||||
from appPublic.jsonConfig import getConfig
|
||||
from appPublic.timeUtils import timestampstr
|
||||
from sqlor.dbpools import DBPools, get_sor_context
|
||||
from ahserver.serverenv import ServerEnv
|
||||
@ -1,34 +1,34 @@
|
||||
{
|
||||
"tblname": "discount_customer_bind",
|
||||
"alias": "discount_customer_bind_list",
|
||||
"title": "客户归属",
|
||||
"params": {
|
||||
"browserfields": {
|
||||
"sale_id": {
|
||||
"title": "归属销售",
|
||||
"width": 120
|
||||
},
|
||||
"promo_code_id": {
|
||||
"title": "促销码",
|
||||
"width": 150
|
||||
},
|
||||
"bind_type": {
|
||||
"title": "绑定方式",
|
||||
"width": 100
|
||||
},
|
||||
"created_at": {
|
||||
"title": "绑定时间",
|
||||
"width": 160
|
||||
}
|
||||
},
|
||||
"editexclouded": [
|
||||
"customerid",
|
||||
"resellerid"
|
||||
],
|
||||
"editable": {
|
||||
"new_data_url": "{{entire_url('../api/customer_bind_create.dspy')}}",
|
||||
"update_data_url": "{{entire_url('../api/customer_bind_update.dspy')}}",
|
||||
"delete_data_url": "{{entire_url('../api/customer_bind_delete.dspy')}}"
|
||||
}
|
||||
}
|
||||
}
|
||||
"tblname": "discount_customer_bind",
|
||||
"alias": "discount_customer_bind_list",
|
||||
"title": "客户归属",
|
||||
"params": {
|
||||
"browserfields": {
|
||||
"sale_id": {
|
||||
"title": "归属销售",
|
||||
"width": 120
|
||||
},
|
||||
"promo_code_id": {
|
||||
"title": "促销码",
|
||||
"width": 150
|
||||
},
|
||||
"bind_type": {
|
||||
"title": "绑定方式",
|
||||
"width": 100
|
||||
},
|
||||
"created_at": {
|
||||
"title": "绑定时间",
|
||||
"width": 160
|
||||
}
|
||||
},
|
||||
"editexclouded": [
|
||||
"customerid",
|
||||
"resellerid"
|
||||
],
|
||||
"editable": {
|
||||
"new_data_url": "{{entire_url('../api/customer_bind_create.dspy')}}",
|
||||
"update_data_url": "{{entire_url('../api/customer_bind_update.dspy')}}",
|
||||
"delete_data_url": "{{entire_url('../api/customer_bind_delete.dspy')}}"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,40 +1,40 @@
|
||||
{
|
||||
"tblname": "discount",
|
||||
"alias": "discount_list",
|
||||
"title": "折扣管理",
|
||||
"params": {
|
||||
"sortby": [
|
||||
"enabled_date desc"
|
||||
],
|
||||
"browserfields": {
|
||||
"exclouded": [
|
||||
"id",
|
||||
"resellerid"
|
||||
],
|
||||
"alters": {
|
||||
"customerid": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_customer_list.dspy')}}",
|
||||
"datamethod": "GET"
|
||||
}
|
||||
}
|
||||
},
|
||||
"editexclouded": [
|
||||
"id",
|
||||
"resellerid"
|
||||
],
|
||||
"editable": {
|
||||
"new_data_url": "{{entire_url('../api/discount_create.dspy')}}",
|
||||
"update_data_url": "{{entire_url('../api/discount_update.dspy')}}",
|
||||
"delete_data_url": "{{entire_url('../api/discount_delete.dspy')}}"
|
||||
},
|
||||
"logined_userorgid": "resellerid",
|
||||
"subtables": [
|
||||
{
|
||||
"field": "discountid",
|
||||
"title": "设置产品折扣",
|
||||
"subtable": "discount_setting"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
"tblname": "discount",
|
||||
"alias": "discount_list",
|
||||
"title": "折扣管理",
|
||||
"params": {
|
||||
"sortby": [
|
||||
"enabled_date desc"
|
||||
],
|
||||
"browserfields": {
|
||||
"exclouded": [
|
||||
"id",
|
||||
"resellerid"
|
||||
],
|
||||
"alters": {
|
||||
"customerid": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_customer_list.dspy')}}",
|
||||
"datamethod": "GET"
|
||||
}
|
||||
}
|
||||
},
|
||||
"editexclouded": [
|
||||
"id",
|
||||
"resellerid"
|
||||
],
|
||||
"editable": {
|
||||
"new_data_url": "{{entire_url('../api/discount_create.dspy')}}",
|
||||
"update_data_url": "{{entire_url('../api/discount_update.dspy')}}",
|
||||
"delete_data_url": "{{entire_url('../api/discount_delete.dspy')}}"
|
||||
},
|
||||
"logined_userorgid": "resellerid",
|
||||
"subtables": [
|
||||
{
|
||||
"field": "discountid",
|
||||
"title": "设置产品折扣",
|
||||
"subtable": "discount_setting"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,64 +1,64 @@
|
||||
{
|
||||
"tblname": "discount_marketing",
|
||||
"alias": "discount_marketing_list",
|
||||
"title": "营销方案",
|
||||
"params": {
|
||||
"browserfields": {
|
||||
"name": {
|
||||
"title": "方案名称"
|
||||
},
|
||||
"enabled_date": {
|
||||
"title": "启用日期",
|
||||
"width": 120
|
||||
},
|
||||
"expired_date": {
|
||||
"title": "失效日期",
|
||||
"width": 120
|
||||
},
|
||||
"status": {
|
||||
"title": "状态",
|
||||
"width": 80
|
||||
}
|
||||
},
|
||||
"editexclouded": [
|
||||
"id",
|
||||
"resellerid",
|
||||
"created_by",
|
||||
"created_at",
|
||||
"updated_at"
|
||||
],
|
||||
"toolbar": {
|
||||
"tools": [
|
||||
{
|
||||
"name": "detail",
|
||||
"selected_row": true,
|
||||
"label": "产品明细",
|
||||
"icon": "{{entire_url('/bricks/imgs/list.svg')}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"binds": [
|
||||
{
|
||||
"wid": "self",
|
||||
"event": "detail",
|
||||
"actiontype": "urlwidget",
|
||||
"target": "app.sage_main_content",
|
||||
"params_mapping": {
|
||||
"mapping": {
|
||||
"id": "discountid"
|
||||
},
|
||||
"need_other": false
|
||||
},
|
||||
"options": {
|
||||
"url": "{{entire_url('../marketing_discount_setting')}}"
|
||||
}
|
||||
}
|
||||
],
|
||||
"editable": {
|
||||
"new_data_url": "{{entire_url('../api/marketing_create.dspy')}}",
|
||||
"update_data_url": "{{entire_url('../api/marketing_update.dspy')}}",
|
||||
"delete_data_url": "{{entire_url('../api/marketing_delete.dspy')}}"
|
||||
},
|
||||
"logined_userorgid": "resellerid"
|
||||
}
|
||||
"tblname": "discount_marketing",
|
||||
"alias": "discount_marketing_list",
|
||||
"title": "营销方案",
|
||||
"params": {
|
||||
"browserfields": {
|
||||
"name": {
|
||||
"title": "方案名称"
|
||||
},
|
||||
"enabled_date": {
|
||||
"title": "启用日期",
|
||||
"width": 120
|
||||
},
|
||||
"expired_date": {
|
||||
"title": "失效日期",
|
||||
"width": 120
|
||||
},
|
||||
"status": {
|
||||
"title": "状态",
|
||||
"width": 80
|
||||
}
|
||||
},
|
||||
"editexclouded": [
|
||||
"id",
|
||||
"resellerid",
|
||||
"created_by",
|
||||
"created_at",
|
||||
"updated_at"
|
||||
],
|
||||
"toolbar": {
|
||||
"tools": [
|
||||
{
|
||||
"name": "detail",
|
||||
"selected_row": true,
|
||||
"label": "产品明细",
|
||||
"icon": "{{entire_url('/bricks/imgs/list.svg')}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"binds": [
|
||||
{
|
||||
"wid": "self",
|
||||
"event": "detail",
|
||||
"actiontype": "urlwidget",
|
||||
"target": "app.sage_main_content",
|
||||
"params_mapping": {
|
||||
"mapping": {
|
||||
"id": "discountid"
|
||||
},
|
||||
"need_other": false
|
||||
},
|
||||
"options": {
|
||||
"url": "{{entire_url('../marketing_discount_setting')}}"
|
||||
}
|
||||
}
|
||||
],
|
||||
"editable": {
|
||||
"new_data_url": "{{entire_url('../api/marketing_create.dspy')}}",
|
||||
"update_data_url": "{{entire_url('../api/marketing_update.dspy')}}",
|
||||
"delete_data_url": "{{entire_url('../api/marketing_delete.dspy')}}"
|
||||
},
|
||||
"logined_userorgid": "resellerid"
|
||||
}
|
||||
}
|
||||
@ -1,63 +1,65 @@
|
||||
{
|
||||
"tblname": "discount_promo_code",
|
||||
"alias": "discount_promo_code_list",
|
||||
"title": "促销码",
|
||||
"params": {
|
||||
"browserfields": {
|
||||
"exclouded": ["id"],
|
||||
"marketing_id": {
|
||||
"title": "营销方案",
|
||||
"width": 150
|
||||
},
|
||||
"code_type": {
|
||||
"title": "类型",
|
||||
"width": 80
|
||||
},
|
||||
"status": {
|
||||
"title": "状态",
|
||||
"width": 80
|
||||
},
|
||||
"created_at": {
|
||||
"title": "生成时间",
|
||||
"width": 160
|
||||
}
|
||||
},
|
||||
"editexclouded": [
|
||||
"id",
|
||||
"resellerid",
|
||||
"sale_id",
|
||||
"created_at"
|
||||
],
|
||||
"toolbar": {
|
||||
"tools": [
|
||||
{
|
||||
"name": "generate_qr",
|
||||
"label": "生成二维码",
|
||||
"selected_row": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"binds": [
|
||||
{
|
||||
"wid": "self",
|
||||
"event": "generate_qr",
|
||||
"actiontype": "urlwidget",
|
||||
"target": "PopupWindow",
|
||||
"popup_options": {
|
||||
"title": "促销码二维码",
|
||||
"cwidth": 18,
|
||||
"cheight": 22
|
||||
},
|
||||
"options": {
|
||||
"url": "{{entire_url('../api/promo_code_qr.dspy')}}?id=${id}$"
|
||||
}
|
||||
}
|
||||
],
|
||||
"editable": {
|
||||
"new_data_url": "{{entire_url('../api/promo_code_create.dspy')}}",
|
||||
"update_data_url": "{{entire_url('../api/promo_code_update.dspy')}}",
|
||||
"delete_data_url": "{{entire_url('../api/promo_code_delete.dspy')}}"
|
||||
},
|
||||
"logined_userorgid": "resellerid"
|
||||
}
|
||||
}
|
||||
"tblname": "discount_promo_code",
|
||||
"alias": "discount_promo_code_list",
|
||||
"title": "促销码",
|
||||
"params": {
|
||||
"browserfields": {
|
||||
"exclouded": [
|
||||
"id"
|
||||
],
|
||||
"marketing_id": {
|
||||
"title": "营销方案",
|
||||
"width": 150
|
||||
},
|
||||
"code_type": {
|
||||
"title": "类型",
|
||||
"width": 80
|
||||
},
|
||||
"status": {
|
||||
"title": "状态",
|
||||
"width": 80
|
||||
},
|
||||
"created_at": {
|
||||
"title": "生成时间",
|
||||
"width": 160
|
||||
}
|
||||
},
|
||||
"editexclouded": [
|
||||
"id",
|
||||
"resellerid",
|
||||
"sale_id",
|
||||
"created_at"
|
||||
],
|
||||
"toolbar": {
|
||||
"tools": [
|
||||
{
|
||||
"name": "generate_qr",
|
||||
"label": "生成二维码",
|
||||
"selected_row": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"binds": [
|
||||
{
|
||||
"wid": "self",
|
||||
"event": "generate_qr",
|
||||
"actiontype": "urlwidget",
|
||||
"target": "PopupWindow",
|
||||
"popup_options": {
|
||||
"title": "促销码二维码",
|
||||
"cwidth": 18,
|
||||
"cheight": 22
|
||||
},
|
||||
"options": {
|
||||
"url": "{{entire_url('../api/promo_code_qr.dspy')}}?id=${id}$"
|
||||
}
|
||||
}
|
||||
],
|
||||
"editable": {
|
||||
"new_data_url": "{{entire_url('../api/promo_code_create.dspy')}}",
|
||||
"update_data_url": "{{entire_url('../api/promo_code_update.dspy')}}",
|
||||
"delete_data_url": "{{entire_url('../api/promo_code_delete.dspy')}}"
|
||||
},
|
||||
"logined_userorgid": "resellerid"
|
||||
}
|
||||
}
|
||||
@ -1,26 +1,39 @@
|
||||
{
|
||||
"tblname": "reseller_discount_tier",
|
||||
"title": "阶梯折扣管理",
|
||||
"params": {
|
||||
"sortby": "sort_order asc",
|
||||
"logined_userorgid": "resellerid",
|
||||
"browserfields": {
|
||||
"exclouded": ["id"],
|
||||
"alters": {
|
||||
"status": {
|
||||
"uitype": "code",
|
||||
"data": [
|
||||
{"value": "active", "text": "启用"},
|
||||
{"value": "inactive", "text": "停用"}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"editexclouded": ["id", "created_at", "updated_at"],
|
||||
"editable": {
|
||||
"new_data_url": "{{entire_url('../api/reseller_discount_tier_create.dspy')}}",
|
||||
"update_data_url": "{{entire_url('../api/reseller_discount_tier_update.dspy')}}",
|
||||
"delete_data_url": "{{entire_url('../api/reseller_discount_tier_delete.dspy')}}"
|
||||
}
|
||||
}
|
||||
}
|
||||
"tblname": "reseller_discount_tier",
|
||||
"title": "阶梯折扣管理",
|
||||
"params": {
|
||||
"sortby": "sort_order asc",
|
||||
"logined_userorgid": "resellerid",
|
||||
"browserfields": {
|
||||
"exclouded": [
|
||||
"id"
|
||||
],
|
||||
"alters": {
|
||||
"status": {
|
||||
"uitype": "code",
|
||||
"data": [
|
||||
{
|
||||
"value": "active",
|
||||
"text": "启用"
|
||||
},
|
||||
{
|
||||
"value": "inactive",
|
||||
"text": "停用"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"editexclouded": [
|
||||
"id",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
"resellerid"
|
||||
],
|
||||
"editable": {
|
||||
"new_data_url": "{{entire_url('../api/reseller_discount_tier_create.dspy')}}",
|
||||
"update_data_url": "{{entire_url('../api/reseller_discount_tier_update.dspy')}}",
|
||||
"delete_data_url": "{{entire_url('../api/reseller_discount_tier_delete.dspy')}}"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,62 +1,58 @@
|
||||
{
|
||||
"summary": [
|
||||
{
|
||||
"name": "discount",
|
||||
"title": "折扣表",
|
||||
"primary": ["id"],
|
||||
"catelog": "entity"
|
||||
}
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"name": "id",
|
||||
"title": "id",
|
||||
"type": "str",
|
||||
"length": 32
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"title": "折扣名称",
|
||||
"type": "str",
|
||||
"length": 100
|
||||
},
|
||||
{
|
||||
"name": "resellerid",
|
||||
"title": "商户id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"default": "*"
|
||||
},
|
||||
{
|
||||
"name": "customerid",
|
||||
"title": "客户id(*表示全部客户)",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"default": "*"
|
||||
},
|
||||
{
|
||||
"name": "enabled_date",
|
||||
"title": "启用日期",
|
||||
"type": "date"
|
||||
},
|
||||
{
|
||||
"name": "expired_date",
|
||||
"title": "失效日期",
|
||||
"type": "date"
|
||||
}
|
||||
],
|
||||
"codes": [
|
||||
{
|
||||
"field": "resellerid",
|
||||
"table": "organization",
|
||||
"valuefield": "id",
|
||||
"textfield": "orgname"
|
||||
},
|
||||
{
|
||||
"field": "customerid",
|
||||
"table": "organization",
|
||||
"valuefield": "id",
|
||||
"textfield": "orgname"
|
||||
}
|
||||
]
|
||||
}
|
||||
"summary": [
|
||||
{
|
||||
"name": "discount",
|
||||
"title": "折扣表",
|
||||
"primary": [
|
||||
"id"
|
||||
],
|
||||
"catelog": "entity"
|
||||
}
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"name": "id",
|
||||
"title": "id",
|
||||
"type": "str",
|
||||
"length": 32
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"title": "折扣名称",
|
||||
"type": "str",
|
||||
"length": 100
|
||||
},
|
||||
{
|
||||
"name": "resellerid",
|
||||
"title": "商户id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"default": "*"
|
||||
},
|
||||
{
|
||||
"name": "customerid",
|
||||
"title": "客户id(*表示全部客户)",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"default": "*"
|
||||
},
|
||||
{
|
||||
"name": "enabled_date",
|
||||
"title": "启用日期",
|
||||
"type": "date"
|
||||
},
|
||||
{
|
||||
"name": "expired_date",
|
||||
"title": "失效日期",
|
||||
"type": "date"
|
||||
}
|
||||
],
|
||||
"codes": [
|
||||
{
|
||||
"field": "customerid",
|
||||
"table": "organization",
|
||||
"valuefield": "id",
|
||||
"textfield": "orgname"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,97 +1,102 @@
|
||||
{
|
||||
"summary": [
|
||||
{
|
||||
"name": "discount_customer_bind",
|
||||
"title": "客户归属关系",
|
||||
"primary": ["id"],
|
||||
"catelog": "relation"
|
||||
}
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"name": "id",
|
||||
"title": "id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "customerid",
|
||||
"title": "客户用户id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "resellerid",
|
||||
"title": "归属分销商机构id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "sale_id",
|
||||
"title": "归属销售用户id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "promo_code_id",
|
||||
"title": "促销码id(空=非促销码方式)",
|
||||
"type": "str",
|
||||
"length": 32
|
||||
},
|
||||
{
|
||||
"name": "bind_type",
|
||||
"title": "绑定方式(1=促销码 2=手动 3=域名注册)",
|
||||
"type": "char",
|
||||
"length": 1,
|
||||
"default": "1",
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "created_at",
|
||||
"title": "绑定时间",
|
||||
"type": "timestamp",
|
||||
"nullable": "no"
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
{
|
||||
"name": "idx_dcb_customer_reseller",
|
||||
"idxtype": "unique",
|
||||
"idxfields": ["customerid", "resellerid"]
|
||||
},
|
||||
{
|
||||
"name": "idx_dcb_reseller",
|
||||
"idxtype": "index",
|
||||
"idxfields": ["resellerid"]
|
||||
},
|
||||
{
|
||||
"name": "idx_dcb_sale",
|
||||
"idxtype": "index",
|
||||
"idxfields": ["sale_id"]
|
||||
},
|
||||
{
|
||||
"name": "idx_dcb_promo",
|
||||
"idxtype": "index",
|
||||
"idxfields": ["promo_code_id"]
|
||||
}
|
||||
],
|
||||
"codes": [
|
||||
{
|
||||
"field": "resellerid",
|
||||
"table": "organization",
|
||||
"valuefield": "id",
|
||||
"textfield": "orgname"
|
||||
},
|
||||
{
|
||||
"field": "bind_type",
|
||||
"table": "appcodes_kv",
|
||||
"valuefield": "k",
|
||||
"textfield": "v",
|
||||
"cond": "parentid='bind_type'"
|
||||
}
|
||||
]
|
||||
}
|
||||
"summary": [
|
||||
{
|
||||
"name": "discount_customer_bind",
|
||||
"title": "客户归属关系",
|
||||
"primary": [
|
||||
"id"
|
||||
],
|
||||
"catelog": "relation"
|
||||
}
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"name": "id",
|
||||
"title": "id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "customerid",
|
||||
"title": "客户用户id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "resellerid",
|
||||
"title": "归属分销商机构id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "sale_id",
|
||||
"title": "归属销售用户id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "promo_code_id",
|
||||
"title": "促销码id(空=非促销码方式)",
|
||||
"type": "str",
|
||||
"length": 32
|
||||
},
|
||||
{
|
||||
"name": "bind_type",
|
||||
"title": "绑定方式(1=促销码 2=手动 3=域名注册)",
|
||||
"type": "char",
|
||||
"length": 1,
|
||||
"default": "1",
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "created_at",
|
||||
"title": "绑定时间",
|
||||
"type": "timestamp",
|
||||
"nullable": "no"
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
{
|
||||
"name": "idx_dcb_customer_reseller",
|
||||
"idxtype": "unique",
|
||||
"idxfields": [
|
||||
"customerid",
|
||||
"resellerid"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "idx_dcb_reseller",
|
||||
"idxtype": "index",
|
||||
"idxfields": [
|
||||
"resellerid"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "idx_dcb_sale",
|
||||
"idxtype": "index",
|
||||
"idxfields": [
|
||||
"sale_id"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "idx_dcb_promo",
|
||||
"idxtype": "index",
|
||||
"idxfields": [
|
||||
"promo_code_id"
|
||||
]
|
||||
}
|
||||
],
|
||||
"codes": [
|
||||
{
|
||||
"field": "bind_type",
|
||||
"table": "appcodes_kv",
|
||||
"valuefield": "k",
|
||||
"textfield": "v",
|
||||
"cond": "parentid='bind_type'"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,92 +1,94 @@
|
||||
{
|
||||
"summary": [
|
||||
{
|
||||
"name": "discount_detail",
|
||||
"title": "折扣明细表",
|
||||
"primary": ["id"],
|
||||
"catelog": "entity"
|
||||
}
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"name": "id",
|
||||
"title": "id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "discountid",
|
||||
"title": "折扣方案id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "resellerid",
|
||||
"title": "商户id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "prodtypeid",
|
||||
"title": "产品种类id",
|
||||
"type": "str",
|
||||
"length": 32
|
||||
},
|
||||
{
|
||||
"name": "productid",
|
||||
"title": "产品id",
|
||||
"type": "str",
|
||||
"length": 32
|
||||
},
|
||||
{
|
||||
"name": "discount",
|
||||
"title": "折扣",
|
||||
"type": "double",
|
||||
"length": 5,
|
||||
"dec": 4,
|
||||
"nullable": "no"
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
{
|
||||
"name": "idx_dd_discountid",
|
||||
"idxtype": "index",
|
||||
"idxfields": ["discountid"]
|
||||
},
|
||||
{
|
||||
"name": "idx_dd_product",
|
||||
"idxtype": "index",
|
||||
"idxfields": ["discountid", "prodtypeid", "productid"]
|
||||
}
|
||||
],
|
||||
"codes": [
|
||||
{
|
||||
"field": "discountid",
|
||||
"table": "discount",
|
||||
"valuefield": "id",
|
||||
"textfield": "name"
|
||||
},
|
||||
{
|
||||
"field": "resellerid",
|
||||
"table": "organization",
|
||||
"valuefield": "id",
|
||||
"textfield": "orgname"
|
||||
},
|
||||
{
|
||||
"field": "prodtypeid",
|
||||
"table": "product_category",
|
||||
"valuefield": "id",
|
||||
"textfield": "name"
|
||||
},
|
||||
{
|
||||
"field": "productid",
|
||||
"table": "product",
|
||||
"valuefield": "id",
|
||||
"textfield": "product_name",
|
||||
"cond": "category_id=[[prodtypeid]]"
|
||||
}
|
||||
]
|
||||
}
|
||||
"summary": [
|
||||
{
|
||||
"name": "discount_detail",
|
||||
"title": "折扣明细表",
|
||||
"primary": [
|
||||
"id"
|
||||
],
|
||||
"catelog": "entity"
|
||||
}
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"name": "id",
|
||||
"title": "id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "discountid",
|
||||
"title": "折扣方案id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "resellerid",
|
||||
"title": "商户id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "prodtypeid",
|
||||
"title": "产品种类id",
|
||||
"type": "str",
|
||||
"length": 32
|
||||
},
|
||||
{
|
||||
"name": "productid",
|
||||
"title": "产品id",
|
||||
"type": "str",
|
||||
"length": 32
|
||||
},
|
||||
{
|
||||
"name": "discount",
|
||||
"title": "折扣",
|
||||
"type": "double",
|
||||
"length": 5,
|
||||
"dec": 4,
|
||||
"nullable": "no"
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
{
|
||||
"name": "idx_dd_discountid",
|
||||
"idxtype": "index",
|
||||
"idxfields": [
|
||||
"discountid"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "idx_dd_product",
|
||||
"idxtype": "index",
|
||||
"idxfields": [
|
||||
"discountid",
|
||||
"prodtypeid",
|
||||
"productid"
|
||||
]
|
||||
}
|
||||
],
|
||||
"codes": [
|
||||
{
|
||||
"field": "discountid",
|
||||
"table": "discount",
|
||||
"valuefield": "id",
|
||||
"textfield": "name"
|
||||
},
|
||||
{
|
||||
"field": "prodtypeid",
|
||||
"table": "product_category",
|
||||
"valuefield": "id",
|
||||
"textfield": "name"
|
||||
},
|
||||
{
|
||||
"field": "productid",
|
||||
"table": "product",
|
||||
"valuefield": "id",
|
||||
"textfield": "product_name",
|
||||
"cond": "category_id=[[prodtypeid]]"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,95 +1,95 @@
|
||||
{
|
||||
"summary": [
|
||||
{
|
||||
"name": "discount_marketing",
|
||||
"title": "营销方案",
|
||||
"primary": ["id"],
|
||||
"catelog": "entity"
|
||||
}
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"name": "id",
|
||||
"title": "id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "resellerid",
|
||||
"title": "商户机构id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"title": "方案名称",
|
||||
"type": "str",
|
||||
"length": 255,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "enabled_date",
|
||||
"title": "启用日期",
|
||||
"type": "date"
|
||||
},
|
||||
{
|
||||
"name": "expired_date",
|
||||
"title": "失效日期",
|
||||
"type": "date"
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"title": "状态",
|
||||
"type": "char",
|
||||
"length": 1,
|
||||
"default": "1"
|
||||
},
|
||||
{
|
||||
"name": "created_by",
|
||||
"title": "创建人",
|
||||
"type": "str",
|
||||
"length": 32
|
||||
},
|
||||
{
|
||||
"name": "created_at",
|
||||
"title": "创建时间",
|
||||
"type": "timestamp",
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"title": "更新时间",
|
||||
"type": "timestamp",
|
||||
"nullable": "no"
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
{
|
||||
"name": "idx_dm_reseller",
|
||||
"idxtype": "index",
|
||||
"idxfields": ["resellerid"]
|
||||
},
|
||||
{
|
||||
"name": "idx_dm_status",
|
||||
"idxtype": "index",
|
||||
"idxfields": ["status"]
|
||||
}
|
||||
],
|
||||
"codes": [
|
||||
{
|
||||
"field": "resellerid",
|
||||
"table": "organization",
|
||||
"valuefield": "id",
|
||||
"textfield": "orgname"
|
||||
},
|
||||
{
|
||||
"field": "status",
|
||||
"table": "appcodes_kv",
|
||||
"valuefield": "k",
|
||||
"textfield": "v",
|
||||
"cond": "parentid='product_status'"
|
||||
}
|
||||
]
|
||||
}
|
||||
"summary": [
|
||||
{
|
||||
"name": "discount_marketing",
|
||||
"title": "营销方案",
|
||||
"primary": [
|
||||
"id"
|
||||
],
|
||||
"catelog": "entity"
|
||||
}
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"name": "id",
|
||||
"title": "id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "resellerid",
|
||||
"title": "商户机构id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"title": "方案名称",
|
||||
"type": "str",
|
||||
"length": 255,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "enabled_date",
|
||||
"title": "启用日期",
|
||||
"type": "date"
|
||||
},
|
||||
{
|
||||
"name": "expired_date",
|
||||
"title": "失效日期",
|
||||
"type": "date"
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"title": "状态",
|
||||
"type": "char",
|
||||
"length": 1,
|
||||
"default": "1"
|
||||
},
|
||||
{
|
||||
"name": "created_by",
|
||||
"title": "创建人",
|
||||
"type": "str",
|
||||
"length": 32
|
||||
},
|
||||
{
|
||||
"name": "created_at",
|
||||
"title": "创建时间",
|
||||
"type": "timestamp",
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"title": "更新时间",
|
||||
"type": "timestamp",
|
||||
"nullable": "no"
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
{
|
||||
"name": "idx_dm_reseller",
|
||||
"idxtype": "index",
|
||||
"idxfields": [
|
||||
"resellerid"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "idx_dm_status",
|
||||
"idxtype": "index",
|
||||
"idxfields": [
|
||||
"status"
|
||||
]
|
||||
}
|
||||
],
|
||||
"codes": [
|
||||
{
|
||||
"field": "status",
|
||||
"table": "appcodes_kv",
|
||||
"valuefield": "k",
|
||||
"textfield": "v",
|
||||
"cond": "parentid='product_status'"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,104 +1,106 @@
|
||||
{
|
||||
"summary": [
|
||||
{
|
||||
"name": "discount_promo_code",
|
||||
"title": "促销码",
|
||||
"primary": ["id"],
|
||||
"catelog": "entity"
|
||||
}
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"name": "id",
|
||||
"title": "促销码(即id本身)",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "marketing_id",
|
||||
"title": "营销方案id(可空=纯邀请码)",
|
||||
"type": "str",
|
||||
"length": 32
|
||||
},
|
||||
{
|
||||
"name": "resellerid",
|
||||
"title": "所属商户机构id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "sale_id",
|
||||
"title": "生成销售id",
|
||||
"type": "str",
|
||||
"length": 32
|
||||
},
|
||||
{
|
||||
"name": "code_type",
|
||||
"title": "码类型(1=促销码 2=邀请码)",
|
||||
"type": "char",
|
||||
"length": 1,
|
||||
"default": "1",
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"title": "状态",
|
||||
"type": "char",
|
||||
"length": 1,
|
||||
"default": "1"
|
||||
},
|
||||
{
|
||||
"name": "created_at",
|
||||
"title": "生成时间",
|
||||
"type": "timestamp",
|
||||
"nullable": "no"
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
{
|
||||
"name": "idx_dpc_reseller",
|
||||
"idxtype": "index",
|
||||
"idxfields": ["resellerid"]
|
||||
},
|
||||
{
|
||||
"name": "idx_dpc_sale",
|
||||
"idxtype": "index",
|
||||
"idxfields": ["sale_id"]
|
||||
},
|
||||
{
|
||||
"name": "idx_dpc_marketing",
|
||||
"idxtype": "index",
|
||||
"idxfields": ["marketing_id"]
|
||||
}
|
||||
],
|
||||
"codes": [
|
||||
{
|
||||
"field": "resellerid",
|
||||
"table": "organization",
|
||||
"valuefield": "id",
|
||||
"textfield": "orgname"
|
||||
},
|
||||
{
|
||||
"field": "marketing_id",
|
||||
"table": "discount_marketing",
|
||||
"valuefield": "id",
|
||||
"textfield": "name"
|
||||
},
|
||||
{
|
||||
"field": "code_type",
|
||||
"table": "appcodes_kv",
|
||||
"valuefield": "k",
|
||||
"textfield": "v",
|
||||
"cond": "parentid='promo_code_type'"
|
||||
},
|
||||
{
|
||||
"field": "status",
|
||||
"table": "appcodes_kv",
|
||||
"valuefield": "k",
|
||||
"textfield": "v",
|
||||
"cond": "parentid='product_status'"
|
||||
}
|
||||
]
|
||||
}
|
||||
"summary": [
|
||||
{
|
||||
"name": "discount_promo_code",
|
||||
"title": "促销码",
|
||||
"primary": [
|
||||
"id"
|
||||
],
|
||||
"catelog": "entity"
|
||||
}
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"name": "id",
|
||||
"title": "促销码(即id本身)",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "marketing_id",
|
||||
"title": "营销方案id(可空=纯邀请码)",
|
||||
"type": "str",
|
||||
"length": 32
|
||||
},
|
||||
{
|
||||
"name": "resellerid",
|
||||
"title": "所属商户机构id",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "sale_id",
|
||||
"title": "生成销售id",
|
||||
"type": "str",
|
||||
"length": 32
|
||||
},
|
||||
{
|
||||
"name": "code_type",
|
||||
"title": "码类型(1=促销码 2=邀请码)",
|
||||
"type": "char",
|
||||
"length": 1,
|
||||
"default": "1",
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"title": "状态",
|
||||
"type": "char",
|
||||
"length": 1,
|
||||
"default": "1"
|
||||
},
|
||||
{
|
||||
"name": "created_at",
|
||||
"title": "生成时间",
|
||||
"type": "timestamp",
|
||||
"nullable": "no"
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
{
|
||||
"name": "idx_dpc_reseller",
|
||||
"idxtype": "index",
|
||||
"idxfields": [
|
||||
"resellerid"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "idx_dpc_sale",
|
||||
"idxtype": "index",
|
||||
"idxfields": [
|
||||
"sale_id"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "idx_dpc_marketing",
|
||||
"idxtype": "index",
|
||||
"idxfields": [
|
||||
"marketing_id"
|
||||
]
|
||||
}
|
||||
],
|
||||
"codes": [
|
||||
{
|
||||
"field": "marketing_id",
|
||||
"table": "discount_marketing",
|
||||
"valuefield": "id",
|
||||
"textfield": "name"
|
||||
},
|
||||
{
|
||||
"field": "code_type",
|
||||
"table": "appcodes_kv",
|
||||
"valuefield": "k",
|
||||
"textfield": "v",
|
||||
"cond": "parentid='promo_code_type'"
|
||||
},
|
||||
{
|
||||
"field": "status",
|
||||
"table": "appcodes_kv",
|
||||
"valuefield": "k",
|
||||
"textfield": "v",
|
||||
"cond": "parentid='product_status'"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,113 +1,115 @@
|
||||
{
|
||||
"summary": [
|
||||
{
|
||||
"name": "reseller_discount_tier",
|
||||
"title": "分销商阶梯折扣",
|
||||
"primary": ["id"],
|
||||
"catelog": "entity"
|
||||
}
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"name": "id",
|
||||
"title": "主键ID",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "resellerid",
|
||||
"title": "分销商机构ID",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"title": "档位名称",
|
||||
"type": "str",
|
||||
"length": 50,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "min_amount",
|
||||
"title": "最低消费金额",
|
||||
"type": "float",
|
||||
"length": 18,
|
||||
"dec": 2,
|
||||
"nullable": "no",
|
||||
"default": "0.00"
|
||||
},
|
||||
{
|
||||
"name": "max_amount",
|
||||
"title": "最高消费金额(NULL=无上限)",
|
||||
"type": "float",
|
||||
"length": 18,
|
||||
"dec": 2,
|
||||
"nullable": "yes"
|
||||
},
|
||||
{
|
||||
"name": "discount_pct",
|
||||
"title": "折扣百分比",
|
||||
"type": "float",
|
||||
"length": 5,
|
||||
"dec": 2,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "sort_order",
|
||||
"title": "排序",
|
||||
"type": "int",
|
||||
"length": 4,
|
||||
"nullable": "no",
|
||||
"default": "0"
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"title": "状态",
|
||||
"type": "str",
|
||||
"length": 10,
|
||||
"nullable": "no",
|
||||
"default": "active"
|
||||
},
|
||||
{
|
||||
"name": "created_at",
|
||||
"title": "创建时间",
|
||||
"type": "timestamp",
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"title": "更新时间",
|
||||
"type": "timestamp",
|
||||
"nullable": "no"
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
{
|
||||
"name": "idx_rdt_reseller_order",
|
||||
"idxtype": "index",
|
||||
"idxfields": ["resellerid", "sort_order"]
|
||||
},
|
||||
{
|
||||
"name": "idx_rdt_amount",
|
||||
"idxtype": "index",
|
||||
"idxfields": ["resellerid", "min_amount"]
|
||||
}
|
||||
],
|
||||
"codes": [
|
||||
{
|
||||
"field": "resellerid",
|
||||
"table": "organization",
|
||||
"valuefield": "id",
|
||||
"textfield": "orgname"
|
||||
},
|
||||
{
|
||||
"field": "status",
|
||||
"table": "appcodes_kv",
|
||||
"valuefield": "k",
|
||||
"textfield": "v",
|
||||
"cond": "parentid='discount_tier_status'"
|
||||
}
|
||||
]
|
||||
}
|
||||
"summary": [
|
||||
{
|
||||
"name": "reseller_discount_tier",
|
||||
"title": "分销商阶梯折扣",
|
||||
"primary": [
|
||||
"id"
|
||||
],
|
||||
"catelog": "entity"
|
||||
}
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"name": "id",
|
||||
"title": "主键ID",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "resellerid",
|
||||
"title": "分销商机构ID",
|
||||
"type": "str",
|
||||
"length": 32,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"title": "档位名称",
|
||||
"type": "str",
|
||||
"length": 50,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "min_amount",
|
||||
"title": "最低消费金额",
|
||||
"type": "float",
|
||||
"length": 18,
|
||||
"dec": 2,
|
||||
"nullable": "no",
|
||||
"default": "0.00"
|
||||
},
|
||||
{
|
||||
"name": "max_amount",
|
||||
"title": "最高消费金额(NULL=无上限)",
|
||||
"type": "float",
|
||||
"length": 18,
|
||||
"dec": 2,
|
||||
"nullable": "yes"
|
||||
},
|
||||
{
|
||||
"name": "discount_pct",
|
||||
"title": "折扣百分比",
|
||||
"type": "float",
|
||||
"length": 5,
|
||||
"dec": 2,
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "sort_order",
|
||||
"title": "排序",
|
||||
"type": "int",
|
||||
"length": 4,
|
||||
"nullable": "no",
|
||||
"default": "0"
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"title": "状态",
|
||||
"type": "str",
|
||||
"length": 10,
|
||||
"nullable": "no",
|
||||
"default": "active"
|
||||
},
|
||||
{
|
||||
"name": "created_at",
|
||||
"title": "创建时间",
|
||||
"type": "timestamp",
|
||||
"nullable": "no"
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"title": "更新时间",
|
||||
"type": "timestamp",
|
||||
"nullable": "no"
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
{
|
||||
"name": "idx_rdt_reseller_order",
|
||||
"idxtype": "index",
|
||||
"idxfields": [
|
||||
"resellerid",
|
||||
"sort_order"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "idx_rdt_amount",
|
||||
"idxtype": "index",
|
||||
"idxfields": [
|
||||
"resellerid",
|
||||
"min_amount"
|
||||
]
|
||||
}
|
||||
],
|
||||
"codes": [
|
||||
{
|
||||
"field": "status",
|
||||
"table": "appcodes_kv",
|
||||
"valuefield": "k",
|
||||
"textfield": "v",
|
||||
"cond": "parentid='discount_tier_status'"
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user