info key刷新时间调整
This commit is contained in:
parent
ac5bff67ee
commit
2b5aff14a8
@ -46,6 +46,7 @@ class RelushADinfo(Resource):
|
|||||||
if areas:
|
if areas:
|
||||||
for area in areas:
|
for area in areas:
|
||||||
info = self._get_adinfo(adid)
|
info = self._get_adinfo(adid)
|
||||||
|
if info:
|
||||||
info['area'] = area
|
info['area'] = area
|
||||||
full_info = self._update_localtion(locationid, info)
|
full_info = self._update_localtion(locationid, info)
|
||||||
for item in self.remove_list:
|
for item in self.remove_list:
|
||||||
@ -94,16 +95,18 @@ class RelushADinfo(Resource):
|
|||||||
|
|
||||||
data = self.mydb.query(sql)
|
data = self.mydb.query(sql)
|
||||||
if data:
|
if data:
|
||||||
for line in data:
|
|
||||||
if line:
|
|
||||||
item = {}
|
|
||||||
try:
|
try:
|
||||||
item['id'], item['name'], item['ad_num'], item['ad_title'], item['ad_body'], item['ad_image'], \
|
line = data[0]
|
||||||
item['jump_param'], item['ad_sort'], item['companyid'], item['gameid'], item['channelid'], \
|
except Exception:
|
||||||
item['jump_status'], item['locationid'], item['ad_property'], item['createtime'] = line
|
log.error(f"split data {data} failed!", exc_info=True)
|
||||||
|
if line:
|
||||||
|
try:
|
||||||
|
item = {}
|
||||||
|
item['id'], item['name'], item['ad_num'], item['ad_title'], item['ad_body'], item['ad_image'], item[
|
||||||
|
'jump_param'], item['ad_sort'], item['companyid'], item['gameid'], item['channelid'], item[
|
||||||
|
'jump_status'], item['locationid'], item['ad_property'], item['createtime'] = line
|
||||||
item['createtime'] = datetime.datetime.strftime(item['createtime'], "%Y-%m-%d %H:%M:%S")
|
item['createtime'] = datetime.datetime.strftime(item['createtime'], "%Y-%m-%d %H:%M:%S")
|
||||||
if item.get('jump_param', "") and (item['ad_property'].find("jump_param") == -1):
|
if item.get('jump_param', "") and (item['ad_property'].find("jump_param") == -1):
|
||||||
try:
|
|
||||||
temp = {}
|
temp = {}
|
||||||
temp['jump_param'] = item.get('jump_param', "")
|
temp['jump_param'] = item.get('jump_param', "")
|
||||||
if not item['ad_property']:
|
if not item['ad_property']:
|
||||||
@ -116,13 +119,15 @@ class RelushADinfo(Resource):
|
|||||||
item.get('ad_property', {}).replace("‘", '"').replace("’", '"'))
|
item.get('ad_property', {}).replace("‘", '"').replace("’", '"'))
|
||||||
item['ad_property'].update(temp)
|
item['ad_property'].update(temp)
|
||||||
item['ad_property'] = json.dumps(item['ad_property'])
|
item['ad_property'] = json.dumps(item['ad_property'])
|
||||||
|
return item
|
||||||
except Exception:
|
except Exception:
|
||||||
log.error(f"write {item}", exc_info=True)
|
log.error(f"write {item}", exc_info=True)
|
||||||
all.append(item)
|
return None
|
||||||
except Exception:
|
else:
|
||||||
log.error("split data failed", exc_info=True)
|
return None
|
||||||
return all
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _update_localtion(self, id, line):
|
def _update_localtion(self, id, line):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user