From 9a5439f3a7369035941e15bf7ab5b150e5edf189 Mon Sep 17 00:00:00 2001 From: "shenjian@fangjia.com" Date: Mon, 5 Dec 2022 16:22:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=BF=91=E5=8D=8A=E5=B9=B4?= =?UTF-8?q?=E6=8C=82=E7=89=8C=E9=87=8F=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/business/business/community/sell.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dags/business/business/community/sell.py b/dags/business/business/community/sell.py index 0b5c9d3..df9bb88 100644 --- a/dags/business/business/community/sell.py +++ b/dags/business/business/community/sell.py @@ -20,6 +20,9 @@ def build_doc(item): doc_dict = dict() if 'three_months_sell_num' in item and pd.notna(item['three_months_sell_num']): doc_dict['three_months_sell_num'] = int(item['three_months_sell_num']) + + if 'half_on_year_sell_num' in item and pd.notna(item['half_on_year_sell_num']): + doc_dict['half_on_year_sell_num'] = int(item['half_on_year_sell_num']) return doc_dict @@ -46,8 +49,12 @@ def sync(city=None): names_str = "'" + names_str + "'" # 近三个月挂牌量 - sample_num = commutils.get_sample(curr_city, curr_region, names_str, cat='sell', daysBefore=93) - seaweed_df.loc[index, 'three_months_sell_num'] = sample_num + # sample_num = commutils.get_sample(curr_city, curr_region, names_str, cat='sell', daysBefore=93) + # seaweed_df.loc[index, 'three_months_sell_num'] = sample_num + + # 近半年挂牌量 + sample_num = commutils.get_sample(curr_city, curr_region, names_str, cat='sell', daysBefore=186) + seaweed_df.loc[index, 'half_on_year_sell_num'] = sample_num for index, item in seaweed_df.iterrows(): pool.submit(deal, index, item)