Commit d85b4ef3 authored by lcn's avatar lcn

修复Bug

parent b26c194c
......@@ -28,10 +28,10 @@ async def get_elec_price_dao(cid):
async def get_max_demand_by_inlid(inlids):
sql = """SELECT a.has_space,b.related_inlids FROM
sql = """SELECT '[]' as has_space,b.inlid as related_inlids FROM
`algo_md_space_analysis_result` a
LEFT JOIN algo_md_space_analysis_unit b on a.space_analysis_id=b.id
WHERE b.related_inlids in %s ORDER BY a.create_time DESC LIMIT %s"""
WHERE b.inlid in %s ORDER BY a.month DESC LIMIT %s"""
async with MysqlUtil() as conn:
spaces = await conn.fetchall(sql, args=(inlids, len(inlids)))
return spaces
......
......@@ -888,7 +888,7 @@ async def elec_current_service_new15(point_id):
url = f"{SETTING.stb_url}db_electric?tz=Asia/Shanghai"
sql = f"select last_row(*) from mt{mtid}_ele where pid={point_id}"
is_succ, results = await get_td_engine_data(url, sql)
if not is_succ or not results:
if not is_succ or not results or results.get("code") > 0:
return '', {}
head = parse_td_columns(results)
if not results["data"]:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment