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):
|
async def set_promote_discount(request, params_kw):
|
||||||
env = ServerEnv()
|
env = request._run_ns
|
||||||
dbname = env.get_module_dbname('discount')
|
dbname = env.get_module_dbname('discount')
|
||||||
config = getConfig()
|
config = getConfig()
|
||||||
db = DBPools()
|
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
|
||||||
@ -4,7 +4,9 @@
|
|||||||
"title": "促销码",
|
"title": "促销码",
|
||||||
"params": {
|
"params": {
|
||||||
"browserfields": {
|
"browserfields": {
|
||||||
"exclouded": ["id"],
|
"exclouded": [
|
||||||
|
"id"
|
||||||
|
],
|
||||||
"marketing_id": {
|
"marketing_id": {
|
||||||
"title": "营销方案",
|
"title": "营销方案",
|
||||||
"width": 150
|
"width": 150
|
||||||
|
|||||||
@ -5,18 +5,31 @@
|
|||||||
"sortby": "sort_order asc",
|
"sortby": "sort_order asc",
|
||||||
"logined_userorgid": "resellerid",
|
"logined_userorgid": "resellerid",
|
||||||
"browserfields": {
|
"browserfields": {
|
||||||
"exclouded": ["id"],
|
"exclouded": [
|
||||||
|
"id"
|
||||||
|
],
|
||||||
"alters": {
|
"alters": {
|
||||||
"status": {
|
"status": {
|
||||||
"uitype": "code",
|
"uitype": "code",
|
||||||
"data": [
|
"data": [
|
||||||
{"value": "active", "text": "启用"},
|
{
|
||||||
{"value": "inactive", "text": "停用"}
|
"value": "active",
|
||||||
|
"text": "启用"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "inactive",
|
||||||
|
"text": "停用"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"editexclouded": ["id", "created_at", "updated_at"],
|
"editexclouded": [
|
||||||
|
"id",
|
||||||
|
"created_at",
|
||||||
|
"updated_at",
|
||||||
|
"resellerid"
|
||||||
|
],
|
||||||
"editable": {
|
"editable": {
|
||||||
"new_data_url": "{{entire_url('../api/reseller_discount_tier_create.dspy')}}",
|
"new_data_url": "{{entire_url('../api/reseller_discount_tier_create.dspy')}}",
|
||||||
"update_data_url": "{{entire_url('../api/reseller_discount_tier_update.dspy')}}",
|
"update_data_url": "{{entire_url('../api/reseller_discount_tier_update.dspy')}}",
|
||||||
|
|||||||
@ -3,7 +3,9 @@
|
|||||||
{
|
{
|
||||||
"name": "discount",
|
"name": "discount",
|
||||||
"title": "折扣表",
|
"title": "折扣表",
|
||||||
"primary": ["id"],
|
"primary": [
|
||||||
|
"id"
|
||||||
|
],
|
||||||
"catelog": "entity"
|
"catelog": "entity"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -46,12 +48,6 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"codes": [
|
"codes": [
|
||||||
{
|
|
||||||
"field": "resellerid",
|
|
||||||
"table": "organization",
|
|
||||||
"valuefield": "id",
|
|
||||||
"textfield": "orgname"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"field": "customerid",
|
"field": "customerid",
|
||||||
"table": "organization",
|
"table": "organization",
|
||||||
|
|||||||
@ -3,7 +3,9 @@
|
|||||||
{
|
{
|
||||||
"name": "discount_customer_bind",
|
"name": "discount_customer_bind",
|
||||||
"title": "客户归属关系",
|
"title": "客户归属关系",
|
||||||
"primary": ["id"],
|
"primary": [
|
||||||
|
"id"
|
||||||
|
],
|
||||||
"catelog": "relation"
|
"catelog": "relation"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -61,31 +63,34 @@
|
|||||||
{
|
{
|
||||||
"name": "idx_dcb_customer_reseller",
|
"name": "idx_dcb_customer_reseller",
|
||||||
"idxtype": "unique",
|
"idxtype": "unique",
|
||||||
"idxfields": ["customerid", "resellerid"]
|
"idxfields": [
|
||||||
|
"customerid",
|
||||||
|
"resellerid"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "idx_dcb_reseller",
|
"name": "idx_dcb_reseller",
|
||||||
"idxtype": "index",
|
"idxtype": "index",
|
||||||
"idxfields": ["resellerid"]
|
"idxfields": [
|
||||||
|
"resellerid"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "idx_dcb_sale",
|
"name": "idx_dcb_sale",
|
||||||
"idxtype": "index",
|
"idxtype": "index",
|
||||||
"idxfields": ["sale_id"]
|
"idxfields": [
|
||||||
|
"sale_id"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "idx_dcb_promo",
|
"name": "idx_dcb_promo",
|
||||||
"idxtype": "index",
|
"idxtype": "index",
|
||||||
"idxfields": ["promo_code_id"]
|
"idxfields": [
|
||||||
|
"promo_code_id"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"codes": [
|
"codes": [
|
||||||
{
|
|
||||||
"field": "resellerid",
|
|
||||||
"table": "organization",
|
|
||||||
"valuefield": "id",
|
|
||||||
"textfield": "orgname"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"field": "bind_type",
|
"field": "bind_type",
|
||||||
"table": "appcodes_kv",
|
"table": "appcodes_kv",
|
||||||
|
|||||||
@ -3,7 +3,9 @@
|
|||||||
{
|
{
|
||||||
"name": "discount_detail",
|
"name": "discount_detail",
|
||||||
"title": "折扣明细表",
|
"title": "折扣明细表",
|
||||||
"primary": ["id"],
|
"primary": [
|
||||||
|
"id"
|
||||||
|
],
|
||||||
"catelog": "entity"
|
"catelog": "entity"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -54,12 +56,18 @@
|
|||||||
{
|
{
|
||||||
"name": "idx_dd_discountid",
|
"name": "idx_dd_discountid",
|
||||||
"idxtype": "index",
|
"idxtype": "index",
|
||||||
"idxfields": ["discountid"]
|
"idxfields": [
|
||||||
|
"discountid"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "idx_dd_product",
|
"name": "idx_dd_product",
|
||||||
"idxtype": "index",
|
"idxtype": "index",
|
||||||
"idxfields": ["discountid", "prodtypeid", "productid"]
|
"idxfields": [
|
||||||
|
"discountid",
|
||||||
|
"prodtypeid",
|
||||||
|
"productid"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"codes": [
|
"codes": [
|
||||||
@ -69,12 +77,6 @@
|
|||||||
"valuefield": "id",
|
"valuefield": "id",
|
||||||
"textfield": "name"
|
"textfield": "name"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"field": "resellerid",
|
|
||||||
"table": "organization",
|
|
||||||
"valuefield": "id",
|
|
||||||
"textfield": "orgname"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"field": "prodtypeid",
|
"field": "prodtypeid",
|
||||||
"table": "product_category",
|
"table": "product_category",
|
||||||
|
|||||||
@ -3,7 +3,9 @@
|
|||||||
{
|
{
|
||||||
"name": "discount_marketing",
|
"name": "discount_marketing",
|
||||||
"title": "营销方案",
|
"title": "营销方案",
|
||||||
"primary": ["id"],
|
"primary": [
|
||||||
|
"id"
|
||||||
|
],
|
||||||
"catelog": "entity"
|
"catelog": "entity"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -69,21 +71,19 @@
|
|||||||
{
|
{
|
||||||
"name": "idx_dm_reseller",
|
"name": "idx_dm_reseller",
|
||||||
"idxtype": "index",
|
"idxtype": "index",
|
||||||
"idxfields": ["resellerid"]
|
"idxfields": [
|
||||||
|
"resellerid"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "idx_dm_status",
|
"name": "idx_dm_status",
|
||||||
"idxtype": "index",
|
"idxtype": "index",
|
||||||
"idxfields": ["status"]
|
"idxfields": [
|
||||||
|
"status"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"codes": [
|
"codes": [
|
||||||
{
|
|
||||||
"field": "resellerid",
|
|
||||||
"table": "organization",
|
|
||||||
"valuefield": "id",
|
|
||||||
"textfield": "orgname"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"field": "status",
|
"field": "status",
|
||||||
"table": "appcodes_kv",
|
"table": "appcodes_kv",
|
||||||
|
|||||||
@ -3,7 +3,9 @@
|
|||||||
{
|
{
|
||||||
"name": "discount_promo_code",
|
"name": "discount_promo_code",
|
||||||
"title": "促销码",
|
"title": "促销码",
|
||||||
"primary": ["id"],
|
"primary": [
|
||||||
|
"id"
|
||||||
|
],
|
||||||
"catelog": "entity"
|
"catelog": "entity"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -60,26 +62,26 @@
|
|||||||
{
|
{
|
||||||
"name": "idx_dpc_reseller",
|
"name": "idx_dpc_reseller",
|
||||||
"idxtype": "index",
|
"idxtype": "index",
|
||||||
"idxfields": ["resellerid"]
|
"idxfields": [
|
||||||
|
"resellerid"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "idx_dpc_sale",
|
"name": "idx_dpc_sale",
|
||||||
"idxtype": "index",
|
"idxtype": "index",
|
||||||
"idxfields": ["sale_id"]
|
"idxfields": [
|
||||||
|
"sale_id"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "idx_dpc_marketing",
|
"name": "idx_dpc_marketing",
|
||||||
"idxtype": "index",
|
"idxtype": "index",
|
||||||
"idxfields": ["marketing_id"]
|
"idxfields": [
|
||||||
|
"marketing_id"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"codes": [
|
"codes": [
|
||||||
{
|
|
||||||
"field": "resellerid",
|
|
||||||
"table": "organization",
|
|
||||||
"valuefield": "id",
|
|
||||||
"textfield": "orgname"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"field": "marketing_id",
|
"field": "marketing_id",
|
||||||
"table": "discount_marketing",
|
"table": "discount_marketing",
|
||||||
|
|||||||
@ -3,7 +3,9 @@
|
|||||||
{
|
{
|
||||||
"name": "reseller_discount_tier",
|
"name": "reseller_discount_tier",
|
||||||
"title": "分销商阶梯折扣",
|
"title": "分销商阶梯折扣",
|
||||||
"primary": ["id"],
|
"primary": [
|
||||||
|
"id"
|
||||||
|
],
|
||||||
"catelog": "entity"
|
"catelog": "entity"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -87,21 +89,21 @@
|
|||||||
{
|
{
|
||||||
"name": "idx_rdt_reseller_order",
|
"name": "idx_rdt_reseller_order",
|
||||||
"idxtype": "index",
|
"idxtype": "index",
|
||||||
"idxfields": ["resellerid", "sort_order"]
|
"idxfields": [
|
||||||
|
"resellerid",
|
||||||
|
"sort_order"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "idx_rdt_amount",
|
"name": "idx_rdt_amount",
|
||||||
"idxtype": "index",
|
"idxtype": "index",
|
||||||
"idxfields": ["resellerid", "min_amount"]
|
"idxfields": [
|
||||||
|
"resellerid",
|
||||||
|
"min_amount"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"codes": [
|
"codes": [
|
||||||
{
|
|
||||||
"field": "resellerid",
|
|
||||||
"table": "organization",
|
|
||||||
"valuefield": "id",
|
|
||||||
"textfield": "orgname"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"field": "status",
|
"field": "status",
|
||||||
"table": "appcodes_kv",
|
"table": "appcodes_kv",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user