fix some error

This commit is contained in:
pengtao 2019-07-15 16:27:18 +08:00
parent 43ecffc2d9
commit dc9ea6d743
2 changed files with 2 additions and 3 deletions

View File

@ -315,7 +315,7 @@ http://192.168.100.20:8888/ad?name=abc&gameid=1003&locationid=1&ad_title=hello&a
| ad_url | string | 是 | 跳转链接 |
| begin_time | datetime | 否 | 开始时间默认是1999-01-01 |
| end_time | datetime | 否 | 结束时间默认是3000-01-01 |
| ad_num | int | 否 | 投放次数,默认是-1(无限) |
| ad_num | int | 否 | 投放次数,默认是0(次数无限) |
| ad_sort | int | 否 | 优先级默认为0 |
| status | int | 否 | 默认为0未审批1=审批通过2=审批未通过3=暂停 |
| companyid | int | 是 | 广告提交公司 |

View File

@ -63,8 +63,7 @@ def send_cache_data():
num = my_redis.get(f"{key}:num")
if not num:
num=0
print("num was ",num)
if line['num'] != -1 and line['num'] <= num:
if line['ad_num'] > 0 and line['ad_num'] <= num:
# 该广告已播放达到次数,从缓存中清除
my_redis.srem(key, line['id'])
# 清理广告详细记录