fix: wdlyhdl 不再把商家/管事身份错误写成恒为1
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -658,8 +658,8 @@ class DashouZhuceView(APIView):
|
||||
|
||||
data['clumber'] = huiyuan_goumai_list
|
||||
data['dashoustatus'] = 1
|
||||
data['guanshistatus'] = 1 if hasattr(current_user, 'GuanshiProfile') else 0
|
||||
data['shangjiastatus'] = 1 if hasattr(current_user, 'ShangjiaProfile') else 0
|
||||
data['guanshistatus'] = 1 if UserGuanshi.query.filter(user=current_user).exists() else 0
|
||||
data['shangjiastatus'] = 1 if UserShangjia.query.filter(user=current_user).exists() else 0
|
||||
return data
|
||||
|
||||
|
||||
@@ -1118,10 +1118,10 @@ class WechatLoginAndDashouRegisterView(APIView):
|
||||
except UserBoss.DoesNotExist:
|
||||
pass
|
||||
|
||||
# 检查各身份状态(这里用户已是打手,所以都是1)
|
||||
# 检查各身份状态(已是打手 ≠ 已是商家/管事,必须按表真实查询)
|
||||
dashou_status = 1
|
||||
shangjia_status = 1 if UserShangjia.query.filter(user=user_main).exists() else 1 # 确保是1
|
||||
guanshi_status = 1 if UserGuanshi.query.filter(user=user_main).exists() else 1 # 确保是1
|
||||
shangjia_status = 1 if UserShangjia.query.filter(user=user_main).exists() else 0
|
||||
guanshi_status = 1 if UserGuanshi.query.filter(user=user_main).exists() else 0
|
||||
|
||||
# 生成token
|
||||
refresh = RefreshToken.for_user(user_main)
|
||||
@@ -1169,10 +1169,10 @@ class WechatLoginAndDashouRegisterView(APIView):
|
||||
except UserBoss.DoesNotExist:
|
||||
pass
|
||||
|
||||
# 身份状态(刚注册成功,应该都是1)
|
||||
# 刚注册成功:仅打手为1;商家/管事按真实身份
|
||||
dashou_status = 1
|
||||
shangjia_status = 1
|
||||
guanshi_status = 1
|
||||
shangjia_status = 1 if UserShangjia.query.filter(user=user_main).exists() else 0
|
||||
guanshi_status = 1 if UserGuanshi.query.filter(user=user_main).exists() else 0
|
||||
|
||||
# 获取群配置
|
||||
group_info = self.huoquQunPeizhi()
|
||||
|
||||
Reference in New Issue
Block a user