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)