From 7ea08e87572e2fe56d7fb6cca1bd740470ab85f3 Mon Sep 17 00:00:00 2001 From: pengtao Date: Wed, 10 Jul 2019 15:53:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BD=8D=E7=BD=AE=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/ad.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/handler/ad.py b/handler/ad.py index a504956..8ddc2bf 100644 --- a/handler/ad.py +++ b/handler/ad.py @@ -44,12 +44,10 @@ class Ad(Resource): def get(self): gameid = self.args['gameid'] localid = self.args['locationid'] - # begin = self.args['begin_time'] - # end = self.args['end_time'] status = self.args['status'] or 1 if not gameid or not localid: # log.error(f"请输入必须的游戏ID和位置ID字段,当前获得是{gameid},{localid}") - return jsonify({'code': 500, "message": f"请输入必须的游戏ID和位置ID字段,当前获得是{gameid},{localid}"}) + return jsonify({'code': 500, "message": f"请输入必须的游戏ID和位置ID字段,当前获得是{gameid},{localid},{status}"}) now = datetime.datetime.today().strftime("%Y-%m-%d %H:%M:%S") sel_sql = f"select id,name,begin_time,end_time,ad_num,ad_title,ad_body,ad_image,ad_url,ad_sort from ad where gameid='{gameid}' and locationid='{localid}' and status={status};" @@ -64,7 +62,10 @@ class Ad(Resource): except Exception: log.error("split data from mysql failed!", exc_info=True) else: - return jsonify({'code': 404, 'message': f'ad not found with gameid={gameid},localid={localid},now={now}!'}) + return jsonify({ + 'code': 404, + 'message': f'ad not found with gameid={gameid},localid={localid},now={now},status={status}!' + }) def post(self):