配置修改
This commit is contained in:
1 parent
ae779d7d00
commit
c0380d2638
3 files changed
+33
-32
No files matched your search
+6
-8
@@ -79,24 +79,22 @@ def finish_task(data):
|
||||
print(f"{time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())} 执行finish_task({data})异常: {str(e)}")
|
||||
|
||||
# 根据影棚ID 获取影棚的配置,如果没有指定的配置,则返回默认配置
|
||||
def get_floor_sticker_distances(psid,is_default = False):
|
||||
def get_floor_sticker_distances(psid):
|
||||
try:
|
||||
with pymysqlAlias() as conn:
|
||||
cursor = conn.cursor()
|
||||
sql = f'select a.studio_id,value from floor_sticker_link_studio as a left join floor_sticker_distances as b on a.floor_name = b.name where a.studio_id in (0,{psid})'
|
||||
# print(f'sql: {sql}')
|
||||
|
||||
cursor.execute(sql)
|
||||
result = cursor.fetchall()
|
||||
if is_default:
|
||||
return result[0]["value"]
|
||||
|
||||
|
||||
if len(result) == 1:
|
||||
return result[0]["value"]
|
||||
return result[0][1]
|
||||
|
||||
if len(result) == 2:
|
||||
for item in result:
|
||||
if item["studio_id"] == psid:
|
||||
return item["value"]
|
||||
if str(item[0]) == str(psid):
|
||||
return item[1]
|
||||
return "error-配置异常,该影棚有多个地贴配置"
|
||||
except Exception as e:
|
||||
print(f"{time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())} 执行get_floor_sticker_distances()异常: {str(e)}")
|
||||
|
||||
Reference in new issue
Block a user