|
@@ -60,6 +60,43 @@ class OrderInfoAgent(BaseHandler):
|
|
|
self.write_json(data=data)
|
|
|
|
|
|
|
|
|
+class OrderInfoNobody(BaseHandler):
|
|
|
+
|
|
|
+ def post(self):
|
|
|
+ if not self._au:
|
|
|
+ self.write_fail(msg='auth error')
|
|
|
+ else:
|
|
|
+ args = self.get_args()
|
|
|
+ user_id = args.get('user_id')
|
|
|
+
|
|
|
+ db = MysqlUtils()
|
|
|
+ if user_id in super_auth():
|
|
|
+ op = ''
|
|
|
+ else:
|
|
|
+ if len(UserAuthUtils.get_auth_channel(user_id)) == 0:
|
|
|
+ return None, None, None
|
|
|
+ elif len(UserAuthUtils.get_auth_channel(user_id)) == 1:
|
|
|
+ op = f" and b.wx_name = '{UserAuthUtils.get_auth_channel(user_id)[0]}'"
|
|
|
+
|
|
|
+ else:
|
|
|
+ op = f" and b.wx_name in {str(UserAuthUtils.get_auth_channel(user_id))}"
|
|
|
+
|
|
|
+ sql = f'''
|
|
|
+ select row_number() over() as id,
|
|
|
+ d.user_nicename as agent_name
|
|
|
+ from quchen_text.advertiser_vx a
|
|
|
+ left join db_mp.mp_mp_conf b on a.name =b.wx_name
|
|
|
+ left join db_mp.mp_conf_agent c on b.id = c.advertiser_conf_id
|
|
|
+ left join db_mp.h_user d on c.agent_id = d.id
|
|
|
+ where d.user_nicename is not null
|
|
|
+ {op}
|
|
|
+ group by d.user_nicename
|
|
|
+ '''
|
|
|
+ data = db.quchen_text.getData_json(sql)
|
|
|
+ data.insert(0, {'id': -1, 'agent_name': '自然流量渠道'})
|
|
|
+ data.insert(0, {'id': -2, 'agent_name': '客服渠道'})
|
|
|
+ self.write_json(data=data)
|
|
|
+
|
|
|
class OrderInfo(BaseHandler):
|
|
|
|
|
|
def post(self):
|
|
@@ -163,7 +200,7 @@ class OrderInfo(BaseHandler):
|
|
|
op8 = f" and a.order_id='{order_id}'" if order_id else ''
|
|
|
op9 = f" and a.mem_id='{member_id}'" if member_id else ''
|
|
|
op10 = f" and a.status={status} " if status else ''
|
|
|
- op11 = f" and e.name='{game}'" if game else ''
|
|
|
+ op11 = f''' and e.name in ({"'" + "','".join(game) + "'"}) ''' if game else ''
|
|
|
|
|
|
|
|
|
if agent_name and '自然流量渠道' in agent_name and '客服渠道' in agent_name:
|
|
@@ -214,7 +251,7 @@ class OrderInfo(BaseHandler):
|
|
|
and g.app_id = a.app_id and g.mg_mem_id =a.mg_mem_id
|
|
|
left join quchen_text.advertiser_vx h on c.wx_name = h.name
|
|
|
left join db_mp.h_user q on a.agent_id =q.id
|
|
|
-
|
|
|
+
|
|
|
|
|
|
where 1=1 {op} {op1} {op2} {op3} {op4} {op5}
|
|
|
{op6} {op7} {op8} {op9} {op10}
|