jared 3 年之前
父节点
当前提交
531c65550b
共有 1 个文件被更改,包括 8 次插入6 次删除
  1. 8 6
      swire_shop_item_list.py

+ 8 - 6
swire_shop_item_list.py

@@ -382,6 +382,14 @@ def main():
                 pagecnt+=1
                 if pagecnt>=5:
                     break
+                aft_cnt=0
+                cursor = db.query('select count(*) as cnt from swire_store_list where num="'+str(area_num)+'" ')
+                for c in cursor:
+                    aft_cnt=c['cnt']
+                    break
+                db['conv_log'].insert({'num':area_num,'prev':prev_cnt,'next':aft_cnt,'dt':datetime.now()})
+
+
 #            table2.upsert({'kw':keyword,'num':job['num']},['kw'])
             table2.insert({'kw':keyword,'num':job['num']},['kw'])
             db.query('update areacodes set expand = 1 where num="'+str(job['num'])+'" and kw="'+keyword+'" ')
@@ -392,12 +400,6 @@ def main():
             if failcnt>=15:
                 sys.exit()
             pass
-        aft_cnt=0
-        cursor = db.query('select count(*) as cnt from swire_store_list where num="'+str(area_num)+'" ')
-        for c in cursor:
-            aft_cnt=c['cnt']
-            break
-        db['conv_log'].insert({'num':area_num,'prev':prev_cnt,'next':aft_cnt,'dt':datetime.now()})