From 9afffc83a6f5cd639cc3c0130b262ce2a16e1bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=B9=B2?= Date: Wed, 23 May 2018 17:16:58 +0800 Subject: [PATCH] =?UTF-8?q?=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20Pr?= =?UTF-8?q?iceSystem/fangjia/=5F=5Finit=5F=5F.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PriceSystem/fangjia/__init__.py | 34 +++++++++++++++++++++++++++++++++ PriceSystem/test.py | 8 ++++---- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/PriceSystem/fangjia/__init__.py b/PriceSystem/fangjia/__init__.py index 945672e..c8d9cb4 100644 --- a/PriceSystem/fangjia/__init__.py +++ b/PriceSystem/fangjia/__init__.py @@ -334,6 +334,40 @@ def find_seaweed(query, fields=None): return data raise Exception("yang ben cha xun shi bai1") + + + + +def find_region_price(query, fields=None): + # dirlt=p[0] + + # client1 = pymongo.MongoClient('192.168.0.136',27017) + # db1 = client1.fangjia + # seaweed1 = db1.seaweed + # s = time.time() + seawater105 = get_collection("fangjia", "region_stat", '192.168.0.136', 27017) + for err_count in range(0,2): + + try: + # print('flag5') + #lt = seawater105.count(query) + + pos = list(seawater105.find(query)) + data = pandas.DataFrame(pos) + del pos + # print("==================>", time.time() - s) + return data + + except: + + # err_count = err_count + 1 + #lt = seawater105.count(query) + pos = list(seawater105.find(query)) + data = pandas.DataFrame(pos) + del pos + return data + + raise Exception("yang ben cha xun shi bai1") def find_region_district_list_name(query, fields=None): diff --git a/PriceSystem/test.py b/PriceSystem/test.py index a7be9d1..9bf43fa 100644 --- a/PriceSystem/test.py +++ b/PriceSystem/test.py @@ -20,12 +20,12 @@ weekend = get_weekend('20180401') s = time.time() -ct='上海' -rl='长宁' -lk='石林别墅' +ct='嘉兴' +rl='秀洲' +lk='茶香坊北区' ''' -ct='太原'长宁石林别墅 +ct='太原'长宁石林别墅嘉兴', 'region': '秀洲', 'name': '花园小区', rl='万柏林' lk='下元重机宿舍'上海徐汇大大沽路100号小区 '''