feat: 只看审核按俱乐部隔离,商品管理支持俱乐部视图

未绑店出货开关按 club_id 配置;后台商品列表可在具体小程序下管理并切换审核展示。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-21 03:20:03 +08:00
parent ed627fa6f7
commit 6515568ec0
9 changed files with 249 additions and 42 deletions

View File

@@ -237,9 +237,10 @@ class ShopProductModifyView(APIView):
# 提取相对路径
tupian_url = full_url.replace(settings.COS_DOMAIN.rstrip('/') + '/', '', 1)
# 审核状态
audit_config = DianpuShangpinShenheShezhi.query.filter(id=1).first()
shenhe_status = not (audit_config and audit_config.kaiqi_shenhe)
# 审核状态(按店铺所属俱乐部)
from shop.services.shenhe_config import is_kaiqi_shenhe_enabled
shop_club = getattr(dianpu, 'club_id', None) or 'xq'
shenhe_status = not is_kaiqi_shenhe_enabled(shop_club)
ShangpinLeixingDianpu.query.create(
dianpu_id=dianpu.id,
@@ -320,8 +321,9 @@ class ShopProductModifyView(APIView):
# 审核重置
if content_changed:
audit_config = DianpuShangpinShenheShezhi.query.filter(id=1).first()
if audit_config and audit_config.kaiqi_shenhe:
from shop.services.shenhe_config import is_kaiqi_shenhe_enabled
shop_club = getattr(dianpu, 'club_id', None) or 'xq'
if is_kaiqi_shenhe_enabled(shop_club):
obj.shenhe_zhuangtai = False
update_fields.append('shenhe_zhuangtai')
@@ -872,8 +874,9 @@ class ShopProductModifyView1(APIView):
content_changed = True
if content_changed:
audit_config = DianpuShangpinShenheShezhi.query.filter(id=1).first()
if audit_config and audit_config.kaiqi_shenhe:
from shop.services.shenhe_config import is_kaiqi_shenhe_enabled
shop_club = getattr(dianpu, 'club_id', None) or 'xq'
if is_kaiqi_shenhe_enabled(shop_club):
product.shenhe_zhuangtai = False
update_fields.append('shenhe_zhuangtai')
@@ -962,8 +965,9 @@ class ShopProductModifyView1(APIView):
return Response({'code': 400, 'msg': '分成金额不能超过商品价格'})'''
shenhe_status = True
audit_config = DianpuShangpinShenheShezhi.query.filter(id=1).first()
if audit_config and audit_config.kaiqi_shenhe:
from shop.services.shenhe_config import is_kaiqi_shenhe_enabled
shop_club = getattr(dianpu, 'club_id', None) or 'xq'
if is_kaiqi_shenhe_enabled(shop_club):
shenhe_status = False
product = Shangpin.query.create(