This commit is contained in:
ping 2026-07-29 17:44:32 +08:00
parent a66a9ee56c
commit 65d5dc0920
2 changed files with 6 additions and 3 deletions

View File

@ -32,8 +32,8 @@ async def news_article_add(ns={}):
'content_zh': ns.get('content_zh'), 'content_zh': ns.get('content_zh'),
'content_en': ns.get('content_en'), 'content_en': ns.get('content_en'),
'status': status, 'status': status,
'publish_time_zh': ns.get('publish_time_zh'), 'publish_time_zh': ns.get('publish_time_zh') or None,
'publish_time_en': ns.get('publish_time_en'), 'publish_time_en': ns.get('publish_time_en') or None,
'read_count': 0, 'read_count': 0,
'del_flg': '0' 'del_flg': '0'
} }

View File

@ -14,6 +14,9 @@ async def news_article_update(ns={}):
'cover_img_zh', 'cover_img_en', 'publish_time_zh', 'publish_time_en' 'cover_img_zh', 'cover_img_en', 'publish_time_zh', 'publish_time_en'
]: ]:
if field in ns: if field in ns:
if field in ['publish_time_zh', 'publish_time_en']:
ns_dic[field] = ns.get(field) or None
else:
ns_dic[field] = ns.get(field) ns_dic[field] = ns.get(field)
if 'status' in ns: if 'status' in ns:
if ns.get('status') not in ['0', '1']: if ns.get('status') not in ['0', '1']: