feat: 点单端邀请绑定与只看审核商品开关

复用 ClubMiniappIcon 增加点单端海报背景;新增 C 端邀请码/换绑店铺接口;hqsp 支持 zhi_kan_shenhe,不影响支付抢单分红。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-21 02:37:31 +08:00
parent d5b8ff5b8a
commit 60d8b52693
14 changed files with 615 additions and 7 deletions

View File

@@ -169,13 +169,26 @@ class ShopGoodsView(APIView):
if dianpu.zhuangtai == 1 and shop_club == club_id:
data = self._get_shop_goods(dianpu)
else:
# 店铺封禁或不属于当前俱乐部 → 公共商品
# 店铺封禁或不属于当前俱乐部 → 公共正常商品
data = self._get_public_goods(True)
else:
data = self._get_public_goods(has_special)
# 未绑店:受「是否只看审核」开关控制
# 开启 → 有特殊身份看正常(=1),否则看审核专用(=2)
# 关闭 → 一律看正常公共商品(与身份无关)
use_normal = True
if self._is_zhi_kan_shenhe_enabled():
use_normal = has_special
data = self._get_public_goods(use_normal)
return Response({'code': 200, 'data': data})
def _is_zhi_kan_shenhe_enabled(self):
"""全局开关:未绑店用户是否按身份只看审核专用商品。默认开启以保持历史行为。"""
config = DianpuShangpinShenheShezhi.query.filter(id=1).first()
if not config:
return True
return bool(getattr(config, 'zhi_kan_shenhe', True))
def _has_special_identity(self, user_main):
"""判断用户是否拥有打手/商家/管事/组长任一身份"""
return (UserDashou.query.filter(user=user_main).exists() or