|
@@ -140,44 +140,44 @@ def get_next_job(db,repeat=False,repkw=None,repnum=None):
|
|
|
result['kw']=repkw
|
|
|
result['num']=repnum
|
|
|
|
|
|
- if 'REP' in repkw:
|
|
|
- if repnum=='REP':
|
|
|
- repnum=None
|
|
|
-# cursor = db.query('select num from swire_store_list where num not in (select num from conv_log) order by rand() limit 1')
|
|
|
-
|
|
|
- cursor = db.query('select num from swire_store_list order by rand() limit 1')
|
|
|
- for c in cursor:
|
|
|
- repnum=c['num']
|
|
|
- break
|
|
|
- if repnum is None:
|
|
|
- cursor = db.query('select num from swire_store_list order by rand() limit 1')
|
|
|
- for c in cursor:
|
|
|
- repnum=c['num']
|
|
|
- break
|
|
|
+# if 'REP' in repkw:
|
|
|
+# if repnum=='REP':
|
|
|
+# repnum=None
|
|
|
+# cursor = db.query('select num from swire_store_list order by rand() limit 1')
|
|
|
+# for c in cursor:
|
|
|
+# repnum=c['num']
|
|
|
+# break
|
|
|
+# if repnum is None:
|
|
|
+# cursor = db.query('select num from swire_store_list order by rand() limit 1')
|
|
|
+# for c in cursor:
|
|
|
+# repnum=c['num']
|
|
|
+# break
|
|
|
|
|
|
|
|
|
# cursor = db.query('select lat_txt,lon_txt,keyword,num from swire_store_list order by rand() limit 1')
|
|
|
- cursor = db.query('select lat_txt,lon_txt,keyword,num from swire_store_list where num="'+str(repnum)+'" limit 1')
|
|
|
-
|
|
|
- for c in cursor:
|
|
|
- result['kw']=c['keyword']
|
|
|
- result['num']=c['num']
|
|
|
- result['lat']=c['lat_txt']
|
|
|
- result['lon']=c['lon_txt']
|
|
|
- result['loc']=''
|
|
|
- return result
|
|
|
+# cursor = db.query('select lat_txt,lon_txt,keyword,num from swire_store_list where num="'+str(repnum)+'" limit 1')
|
|
|
+
|
|
|
+# for c in cursor:
|
|
|
+# result['kw']=c['keyword']
|
|
|
+# result['num']=c['num']
|
|
|
+# result['lat']=c['lat_txt']
|
|
|
+# result['lon']=c['lon_txt']
|
|
|
+# result['loc']=''
|
|
|
+# return result
|
|
|
|
|
|
|
|
|
|
|
|
if repeat:
|
|
|
# cursor = db.query('select lat_txt,lon_txt from swire_store_list where num ="'+str(result['num'])+'" and keyword="'+result['kw']+'" order by rand() limit 1')
|
|
|
# cursor = db.query('select lat_txt,lon_txt,keyword from swire_store_list order by rand() limit 1')
|
|
|
- cursor = db.query('select lat_txt,lon_txt,keyword from swire_store_list where keyword <> "火鍋餐廳" order by rand() limit 1')
|
|
|
+ cursor = db.query('select lat_txt,lon_txt,keyword,num from swire_store_list where keyword <> "火鍋餐廳" order by rand() limit 1')
|
|
|
|
|
|
for c in cursor:
|
|
|
result['kw']=c['keyword']
|
|
|
result['lat']=c['lat_txt']
|
|
|
result['lon']=c['lon_txt']
|
|
|
+ result['num']=c['num']
|
|
|
+ result['loc']=''
|
|
|
|
|
|
return result
|
|
|
|