Commit 6790eec8 authored by lixiaofang's avatar lixiaofang

修改判断方式

parent 4881554d
......@@ -27,6 +27,8 @@ def click(card_info):
else:
redis_data['click_have_pust_num'] = have_pust_num + 1
redis_client.hset(key, str_today, json.dumps(redis_data))
logging.info("当前下发次数:%s,上限是%s次,可以下发:%s" % (have_pust_num, need_pust_num, card_info))
else:
redis_data = {"click_have_pust_num": card_info['have_pust_num'],
"click_need_pust_num": card_info['need_pust_num']}
......
......@@ -117,6 +117,7 @@ def comment(card_info):
else:
datas.append(card_info['comment_content'])
redis_client.hset(key, card_info['current_user_id'], json.dumps(datas))
else:
conent = [card_info['comment_content']]
redis_client.hset(key, card_info['current_user_id'], json.dumps(conent))
......@@ -139,6 +140,8 @@ def comment(card_info):
else:
redis_data['comment_have_pust_num'] = have_pust_num + 1
redis_client.hset(key, str_today, json.dumps(redis_data))
logging.info("当前下发次数:%s,上限是%s次,可以下发:%s" % (have_pust_num, need_pust_num, card_info))
else:
redis_data = {"comment_have_pust_num": card_info['have_pust_num'],
"comment_need_pust_num": card_info['need_pust_num']}
......
......@@ -27,6 +27,7 @@ def follow(card_info):
else:
redis_data['follow_have_pust_num'] = have_pust_num + 1
redis_client.hset(key, str_today, json.dumps(redis_data))
logging.info("当前下发次数:%s,上限是%s次,可以下发:%s" % (have_pust_num, need_pust_num, card_info))
else:
redis_data = {"follow_have_pust_num": card_info['have_pust_num'],
"follow_need_pust_num": card_info['need_pust_num']}
......
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