|
@@ -120,6 +120,9 @@ def get_channel_overview(user_id,channel,pitcher,stage,start,end,page,page_size,
|
|
else:
|
|
else:
|
|
if len(UserAuthUtils.get_auth_channel(user_id)) == 0:
|
|
if len(UserAuthUtils.get_auth_channel(user_id)) == 0:
|
|
return None, None, None
|
|
return None, None, None
|
|
|
|
+
|
|
|
|
+ elif len(UserAuthUtils.get_auth_channel(user_id)) == 1:
|
|
|
|
+ op = f" and channel = '{UserAuthUtils.get_auth_channel(user_id)[0]}'"
|
|
else:
|
|
else:
|
|
op = f" and channel in {str(UserAuthUtils.get_auth_channel(user_id))}"
|
|
op = f" and channel in {str(UserAuthUtils.get_auth_channel(user_id))}"
|
|
|
|
|
|
@@ -374,6 +377,8 @@ def get_channel_active(user_id,channel,pitcher,start,end,page,page_size,order_by
|
|
else:
|
|
else:
|
|
if len(UserAuthUtils.get_auth_channel(user_id)) == 0:
|
|
if len(UserAuthUtils.get_auth_channel(user_id)) == 0:
|
|
return None, None, None
|
|
return None, None, None
|
|
|
|
+ elif len(UserAuthUtils.get_auth_channel(user_id)) == 1:
|
|
|
|
+ op = f" and channel = '{UserAuthUtils.get_auth_channel(user_id)[0]}'"
|
|
else:
|
|
else:
|
|
op = f" and channel in {str(UserAuthUtils.get_auth_channel(user_id))}"
|
|
op = f" and channel in {str(UserAuthUtils.get_auth_channel(user_id))}"
|
|
op1 = f" and pitcher ='{pitcher}' " if pitcher else ''
|
|
op1 = f" and pitcher ='{pitcher}' " if pitcher else ''
|
|
@@ -457,6 +462,9 @@ def get_channel_order_trend(user_id,channel,pitcher,start,end,page,page_size,ord
|
|
else:
|
|
else:
|
|
if len(UserAuthUtils.get_auth_channel(user_id)) == 0:
|
|
if len(UserAuthUtils.get_auth_channel(user_id)) == 0:
|
|
return None, None, None
|
|
return None, None, None
|
|
|
|
+ elif len(UserAuthUtils.get_auth_channel(user_id)) == 1:
|
|
|
|
+ op = f" and channel = '{UserAuthUtils.get_auth_channel(user_id)[0]}'"
|
|
|
|
+
|
|
else:
|
|
else:
|
|
op = f" and channel in {str(UserAuthUtils.get_auth_channel(user_id))}"
|
|
op = f" and channel in {str(UserAuthUtils.get_auth_channel(user_id))}"
|
|
|
|
|
|
@@ -598,7 +606,12 @@ def get_channel_summary(user_id,channel,pitcher,page,page_size,order_by,order,st
|
|
else:
|
|
else:
|
|
channel_li = UserAuthUtils.get_auth_channel(user_id)
|
|
channel_li = UserAuthUtils.get_auth_channel(user_id)
|
|
print(channel_li.__len__())
|
|
print(channel_li.__len__())
|
|
- op = f" and a.channel in {tuple(channel_li)}"
|
|
|
|
|
|
+ if len(channel_li) == 0:
|
|
|
|
+ return None,None,None
|
|
|
|
+ elif len(channel_li) == 1:
|
|
|
|
+ op = f" and a.channel = '{channel_li[0]}'"
|
|
|
|
+ else:
|
|
|
|
+ op = f" and a.channel in {tuple(channel_li)}"
|
|
|
|
|
|
op1=f" and a.channel='{channel}'" if channel else ''
|
|
op1=f" and a.channel='{channel}'" if channel else ''
|
|
op2=f" and pitcher='{pitcher}'" if pitcher else ''
|
|
op2=f" and pitcher='{pitcher}'" if pitcher else ''
|