def old_jd_goods_insert_into_new_table(self, data, pipeline): ''' 老数据转到新表 :param data: :param pipeline: :return: ''' site_id = self._from_jd_type_get_site_id_value(jd_type=data.get('jd_type')) if site_id == 0: self.lg.error('site_id获取异常, 请检查!') return False tmp = _get_right_model_data(data=data, site_id=site_id) self.lg.info('------>>>| 待存储的数据信息为: {0}'.format(tmp.get('goods_id'))) params = self._get_db_insert_params(item=tmp) if tmp.get('main_goods_id') is not None: sql_str = jd_insert_str_1 else: sql_str = jd_insert_str_2 result = pipeline._insert_into_table_2(sql_str=sql_str, params=params, logger=self.lg) return result
def insert_into_pinduoduo_xianshimiaosha_table(self, data, pipeline): tmp = _get_right_model_data(data=data, site_id=16) # 采集来源地(卷皮秒杀商品) print('------>>>| 待存储的数据信息为: ', tmp.get('goods_id')) params = self._get_db_insert_miaosha_params(item=tmp) sql_str = r'insert into dbo.pinduoduo_xianshimiaosha(goods_id, goods_url, username, create_time, modfiy_time, shop_name, goods_name, sub_title, price, taobao_price, sku_name, sku_info, all_image_url, property_info, detail_info, schedule, stock_info, miaosha_time, miaosha_begin_time, miaosha_end_time, site_id, is_delete) values(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' pipeline._insert_into_table(sql_str=sql_str, params=params)
def old_tmall_goods_insert_into_new_table(self, data, pipeline): ''' 老库数据规范,然后存入 :param data: :param pipeline: :return: ''' site_id = self._from_tmall_type_get_site_id(type=data.get('type')) if site_id is False: self.my_lg.error('获取到的site_id为False!出错!请检查!出错goods_id: {0}'.format( data.get('goods_id'))) return None tmp = _get_right_model_data(data=data, site_id=site_id, logger=self.my_lg) params = self._get_db_insert_params(item=tmp) if tmp.get('main_goods_id') is not None: sql_str = 'insert into dbo.GoodsInfoAutoGet(GoodsID, GoodsUrl, UserName, CreateTime, ModfiyTime, ShopName, Account, GoodsName, SubTitle, LinkName, Price, TaoBaoPrice, PriceInfo, SKUName, SKUInfo, ImageUrl, PropertyInfo, DetailInfo, SellCount, SiteID, IsDelete, MainGoodsID) values(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' else: sql_str = 'insert into dbo.GoodsInfoAutoGet(GoodsID, GoodsUrl, UserName, CreateTime, ModfiyTime, ShopName, Account, GoodsName, SubTitle, LinkName, Price, TaoBaoPrice, PriceInfo, SKUName, SKUInfo, ImageUrl, PropertyInfo, DetailInfo, SellCount, SiteID, IsDelete) values(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' result = pipeline._insert_into_table_2(sql_str=sql_str, params=params, logger=self.my_lg) return result
def to_right_and_update_data(self, data, pipeline): ''' 实时更新数据 :param data: :param pipeline: :return: ''' site_id = self._from_tmall_type_get_site_id(type=data.get('type')) if site_id is False: self.my_lg.error('获取到的site_id为False!出错!请检查!出错goods_id: {0}'.format( data.get('goods_id'))) return None tmp = _get_right_model_data(data=data, site_id=site_id, logger=self.my_lg) params = self._get_db_update_params(item=tmp) # 改价格的sql # sql_str = r'update dbo.GoodsInfoAutoGet set ModfiyTime = %s, ShopName=%s, Account=%s, GoodsName=%s, SubTitle=%s, LinkName=%s, Price=%s, TaoBaoPrice=%s, PriceInfo=%s, SKUName=%s, SKUInfo=%s, ImageUrl=%s, PropertyInfo=%s, DetailInfo=%s, SellCount=%s, MyShelfAndDownTime=%s, delete_time=%s, IsDelete=%s, IsPriceChange=%s, PriceChangeInfo=%s where GoodsID = %s' # 不改价格的sql if tmp['delete_time'] == '': sql_str = 'update dbo.GoodsInfoAutoGet set ModfiyTime = %s, ShopName=%s, Account=%s, GoodsName=%s, SubTitle=%s, LinkName=%s, PriceInfo=%s, SKUName=%s, SKUInfo=%s, ImageUrl=%s, PropertyInfo=%s, DetailInfo=%s, SellCount=%s, IsDelete=%s, IsPriceChange=%s, PriceChangeInfo=%s, shelf_time=%s where GoodsID = %s' elif tmp['shelf_time'] == '': sql_str = 'update dbo.GoodsInfoAutoGet set ModfiyTime = %s, ShopName=%s, Account=%s, GoodsName=%s, SubTitle=%s, LinkName=%s, PriceInfo=%s, SKUName=%s, SKUInfo=%s, ImageUrl=%s, PropertyInfo=%s, DetailInfo=%s, SellCount=%s, IsDelete=%s, IsPriceChange=%s, PriceChangeInfo=%s, delete_time=%s where GoodsID = %s' else: sql_str = 'update dbo.GoodsInfoAutoGet set ModfiyTime = %s, ShopName=%s, Account=%s, GoodsName=%s, SubTitle=%s, LinkName=%s, PriceInfo=%s, SKUName=%s, SKUInfo=%s, ImageUrl=%s, PropertyInfo=%s, DetailInfo=%s, SellCount=%s, IsDelete=%s, IsPriceChange=%s, PriceChangeInfo=%s, shelf_time=%s, delete_time=%s where GoodsID = %s' pipeline._update_table_2(sql_str=sql_str, params=params, logger=self.my_lg)
def to_right_and_update_data(self, data, pipeline): ''' 实时更新数据 :param data: :param pipeline: :return: ''' goods_id = data.get('goods_id') try: tmp = _get_right_model_data(data=data, site_id=1, logger=self.lg) except: self.lg.error('遇到错误, 先跳过处理!出错goods_id={0}'.format(goods_id), exc_info=True) return None params = self._get_db_update_params(item=tmp) # 改价格的sql # sql_str = r'update dbo.GoodsInfoAutoGet set ModfiyTime = %s, ShopName=%s, Account=%s, GoodsName=%s, SubTitle=%s, LinkName=%s, Price=%s, TaoBaoPrice=%s, PriceInfo=%s, SKUName=%s, SKUInfo=%s, ImageUrl=%s, PropertyInfo=%s, DetailInfo=%s, SellCount=%s, MyShelfAndDownTime=%s, delete_time=%s, IsDelete=%s, IsPriceChange=%s, PriceChangeInfo=%s where GoodsID = %s' # 不改价格的sql base_sql_str = tb_update_str_1 if tmp['delete_time'] == '': sql_str = base_sql_str.format('shelf_time=%s', '') elif tmp['shelf_time'] == '': sql_str = base_sql_str.format('delete_time=%s', '') else: sql_str = base_sql_str.format('shelf_time=%s,', 'delete_time=%s') pipeline._update_table(sql_str=sql_str, params=params, logger=self.lg)
async def _update_taoqianggou_xianshimiaosha_table(self, data, pipeline): ''' update对应表的数据 :param data: :param pipeline: :return: ''' try: tmp = _get_right_model_data(data=data, site_id=28, logger=self.my_lg) except: self.my_lg.error('获取规范化数据失败!出错goods_id:{0}'.format( data.get('goods_id'))) return None self.my_lg.info('------>>>| 待存储的数据信息为: {0}'.format( data.get('goods_id'))) params = await self._get_db_update_miaosha_params(item=tmp) sql_str = r'update dbo.tao_qianggou_xianshimiaosha set modfiy_time = %s, shop_name=%s, goods_name=%s, sub_title=%s, price=%s, taobao_price=%s, sku_name=%s, sku_Info=%s, all_image_url=%s, property_info=%s, detail_info=%s, is_delete=%s, schedule=%s where goods_id = %s' pipeline._update_table_2(sql_str=sql_str, params=params, logger=self.my_lg) return
async def insert_into_taobao_tiantiantejia_table(self, data, pipeline): try: data['miaosha_begin_time'] = data.get('tejia_begin_time') data['miaosha_end_time'] = data.get('tejia_end_time') data['tab_id'] = data.get('tag_id') tmp = _get_right_model_data(data=data, site_id=19) except Exception: self.lg.error('遇到错误, 先跳过处理!出错goods_id={0}'.format(data['goods_id']), exc_info=True) return False self.lg.info('------>>>| 待存储的数据信息为: ' + str(tmp.get('goods_id'))) params = self._get_db_insert_tejia_params(item=tmp) await pipeline._insert_into_table_3( sql_str=tb_insert_str_3, params=params, logger=self.lg, error_msg_dict={ 'repeat_error': { 'field_name': 'goods_id', 'field_value': tmp.get('goods_id', ''), }, 'other_error': [{ 'field_name': 'goods_url', 'field_value': tmp.get('goods_url'), },] }) return True
def to_update_juanpi_xianshimiaosha_table(self, data, pipeline): tmp = _get_right_model_data(data=data, site_id=15) # print('------>>> | 待存储的数据信息为: |', tmp) print('------>>>| 待存储的数据信息为: |', tmp.get('goods_id')) params = self._get_db_update_miaosha_params(item=tmp) pipeline._update_table(sql_str=jp_update_str_3, params=params)
def old_tmall_goods_insert_into_new_table(self, data, pipeline): ''' 老库数据规范,然后存入 :param data: :param pipeline: :return: ''' site_id = self._from_tmall_type_get_site_id(type=data.get('type')) if site_id is False: self.lg.error('获取到的site_id为False!出错!请检查!出错goods_id: {0}'.format( data.get('goods_id'))) return None tmp = _get_right_model_data(data=data, site_id=site_id, logger=self.lg) params = self._get_db_insert_params(item=tmp) if tmp.get('main_goods_id') is not None: sql_str = tm_insert_str_1 else: sql_str = tm_insert_str_2 result = pipeline._insert_into_table_2(sql_str=sql_str, params=params, logger=self.lg) return result
def old_jd_goods_insert_into_new_table(self, data, pipeline): ''' 老数据转到新表 :param data: :param pipeline: :return: ''' site_id = self._from_jd_type_get_site_id_value( jd_type=data.get('jd_type')) if site_id == 0: print('site_id获取异常, 请检查!') return False tmp = _get_right_model_data(data=data, site_id=site_id) # print('------>>>| 待存储的数据信息为: |', tmp) print('------>>>| 待存储的数据信息为: ', tmp.get('goods_id')) params = self._get_db_insert_params(item=tmp) if tmp.get('main_goods_id') is not None: sql_str = 'insert into dbo.GoodsInfoAutoGet(GoodsID, GoodsUrl, UserName, CreateTime, ModfiyTime, ShopName, Account, GoodsName, SubTitle, LinkName, Price, TaoBaoPrice, PriceInfo, SKUName, SKUInfo, ImageUrl, PropertyInfo, DetailInfo, SellCount, SiteID, IsDelete, MainGoodsID) values(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' else: sql_str = 'insert into dbo.GoodsInfoAutoGet(GoodsID, GoodsUrl, UserName, CreateTime, ModfiyTime, ShopName, Account, GoodsName, SubTitle, LinkName, Price, TaoBaoPrice, PriceInfo, SKUName, SKUInfo, ImageUrl, PropertyInfo, DetailInfo, SellCount, SiteID, IsDelete) values(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' result = pipeline._insert_into_table(sql_str=sql_str, params=params) return result
def to_right_and_update_data(self, data, pipeline): ''' 实时更新数据 :param data: :param pipeline: :return: ''' site_id = self._from_tmall_type_get_site_id(type=data.get('type')) if site_id is False: self.lg.error('获取到的site_id为False!出错!请检查!出错goods_id: {0}'.format( data.get('goods_id'))) return None tmp = _get_right_model_data(data=data, site_id=site_id, logger=self.lg) params = self._get_db_update_params(item=tmp) base_sql_str = tm_update_str_1 if tmp['delete_time'] == '': sql_str = base_sql_str.format('shelf_time=%s', '') elif tmp['shelf_time'] == '': sql_str = base_sql_str.format('delete_time=%s', '') else: sql_str = base_sql_str.format('shelf_time=%s,', 'delete_time=%s') pipeline._update_table_2(sql_str=sql_str, params=params, logger=self.lg)
async def insert_into_jumeiyoupin_pintuan_table(self, data, pipeline, logger): ''' 存储数据 :param data: :param pipeline: :param logger :return: ''' try: tmp = _get_right_model_data(data=data, site_id=27, logger=self.my_lg) # 采集来源地(聚美优品拼团商品) except: self.my_lg.error('此处抓到的可能是聚美优品拼团券所以跳过') return None # print('------>>> | 待存储的数据信息为: |', tmp) self.msg = '------>>>| 待存储的数据信息为: |' + str(tmp.get('goods_id')) logger.info(self.msg) params = await self._get_db_insert_pintuan_params(item=tmp) sql_str = r'insert into dbo.jumeiyoupin_pintuan(goods_id, goods_url, create_time, modfiy_time, shop_name, goods_name, sub_title, price, taobao_price, sku_name, sku_Info, all_image_url, property_info, detail_info, miaosha_time, miaosha_begin_time, miaosha_end_time, all_sell_count, page, sort, tab, site_id, is_delete) values(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' try: pipeline._insert_into_table_2(sql_str=sql_str, params=params, logger=logger) return True except Exception as e: logger.exception(e) return False
async def update_jumeiyoupin_pintuan_table_2(self, data, pipeline, logger) -> bool: ''' 异步更新数据 :param data: :param pipeline: :param logger: :return: ''' try: tmp = _get_right_model_data(data=data, site_id=27, logger=self.my_lg) except: self.my_lg.error('此处抓到的可能是聚美优品拼团券所以跳过') return None # print('------>>> | 待存储的数据信息为: |', tmp) logger.info('------>>>| 待存储的数据信息为: ' + str(tmp.get('goods_id'))) params = await self._get_db_update_pintuan_params_2(item=tmp) # pprint(params) try: result = pipeline._update_table_2(sql_str=jm_update_str_3, params=params, logger=logger) return result except Exception as e: logger.exception(e) return False
async def insert_into_jumeiyoupin_pintuan_table(self, data, pipeline, logger) -> bool: ''' 存储数据 :param data: :param pipeline: :param logger :return: ''' try: tmp = _get_right_model_data(data=data, site_id=27, logger=self.my_lg) # 采集来源地(聚美优品拼团商品) except: self.my_lg.error('此处抓到的可能是聚美优品拼团券所以跳过') return None # print('------>>> | 待存储的数据信息为: |', tmp) self.msg = '------>>>| 待存储的数据信息为: |' + str(tmp.get('goods_id')) logger.info(self.msg) params = await self._get_db_insert_pintuan_params(item=tmp) try: pipeline._insert_into_table_2(sql_str=jm_insert_str_2, params=params, logger=logger) return True except Exception as e: logger.exception(e) return False
def to_right_and_update_data(self, data, pipeline): ''' 实时更新数据 :param data: :param pipeline: :return: ''' site_id = self._from_jd_type_get_site_id_value( jd_type=data.get('jd_type')) tmp = _get_right_model_data(data=data, site_id=site_id) params = self.get_db_update_params(item=tmp) base_sql_str = jd_update_str_1 if tmp['delete_time'] == '': sql_str = base_sql_str.format('shelf_time=%s', '') elif tmp['shelf_time'] == '': sql_str = base_sql_str.format('delete_time=%s', '') else: sql_str = base_sql_str.format('shelf_time=%s,', 'delete_time=%s') res = pipeline._update_table_2(sql_str=sql_str, params=params, logger=self.my_lg) return res
async def update_taobao_tiantiantejia_table(self, data, pipeline): ''' 更新天天秒杀特价的商品信息 :param data: :param pipeline: :param logger :return: ''' try: data['miaosha_begin_time'] = data.get('tejia_begin_time') data['miaosha_end_time'] = data.get('tejia_end_time') tmp = _get_right_model_data(data=data, site_id=19) except Exception: self.lg.error('遇到错误, 先跳过处理!出错goods_id={0}'.format( data['goods_id']), exc_info=True) return False self.lg.info('------>>>| 待存储的数据信息为: |' + tmp.get('goods_id')) params = self._get_db_update_tejia_params(item=tmp) await pipeline._update_table_3(sql_str=tb_update_str_2, params=params, logger=self.lg, error_msg_dict={ 'other_error': [{ 'field_name': 'goods_id', 'field_value': tmp.get('goods_id', ''), }] })
def old_taobao_goods_insert_into_new_table(self, data, pipeline): ''' 得到规范格式的data并且存入数据库 :param data: :param pipeline: :return: ''' goods_id = data.get('goods_id') try: tmp = _get_right_model_data(data=data, site_id=1, logger=self.my_lg) except: self.my_lg.error('遇到错误, 先跳过处理!出错goods_id={0}'.format(goods_id), exc_info=True) return params = self._get_db_insert_params(item=tmp) if tmp.get('main_goods_id') is not None: # main_goods_id不为空 sql_str = r'insert into dbo.GoodsInfoAutoGet(GoodsID, GoodsUrl, UserName, CreateTime, ModfiyTime, ShopName, Account, GoodsName, SubTitle, LinkName, Price, TaoBaoPrice, PriceInfo, SKUName, SKUInfo, ImageUrl, PropertyInfo, DetailInfo, SellCount, SiteID, IsDelete, MainGoodsID) values(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' else: # main_goods_id为空 sql_str = r'insert into dbo.GoodsInfoAutoGet(GoodsID, GoodsUrl, UserName, CreateTime, ModfiyTime, ShopName, Account, GoodsName, SubTitle, LinkName, Price, TaoBaoPrice, PriceInfo, SKUName, SKUInfo, ImageUrl, PropertyInfo, DetailInfo, SellCount, SiteID, IsDelete) values(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' result = pipeline._insert_into_table_2(sql_str=sql_str, params=params, logger=self.my_lg) return result
def old_taobao_goods_insert_into_new_table(self, data, pipeline): ''' 得到规范格式的data并且存入数据库 :param data: :param pipeline: :return: ''' goods_id = data.get('goods_id') try: tmp = _get_right_model_data(data=data, site_id=1, logger=self.lg) except: self.lg.error('遇到错误, 先跳过处理!出错goods_id={0}'.format(goods_id), exc_info=True) return params = self._get_db_insert_params(item=tmp) if tmp.get('main_goods_id') is not None: # main_goods_id不为空 sql_str = tb_insert_str_1 else: # main_goods_id为空 sql_str = tb_insert_str_2 result = pipeline._insert_into_table_2(sql_str=sql_str, params=params, logger=self.lg) return result
async def update_jumeiyoupin_pintuan_table_2(self, data, pipeline, logger): ''' 异步更新数据 :param data: :param pipeline: :param logger: :return: ''' try: tmp = _get_right_model_data(data=data, site_id=27, logger=self.my_lg) except: self.my_lg.error('此处抓到的可能是聚美优品拼团券所以跳过') return None # print('------>>> | 待存储的数据信息为: |', tmp) self.msg = '------>>>| 待存储的数据信息为: |' + str(tmp.get('goods_id')) logger.info(self.msg) params = self._get_db_update_pintuan_params_2(item=tmp) sql_str = 'update dbo.jumeiyoupin_pintuan set modfiy_time=%s, shop_name=%s, goods_name=%s, sub_title=%s, price=%s, taobao_price=%s, sku_name=%s, sku_Info=%s, all_image_url=%s, property_info=%s, detail_info=%s, is_delete=%s, all_sell_count=%s where goods_id = %s' try: result = pipeline._update_table_2(sql_str=sql_str, params=params, logger=logger) return result except Exception as e: logger.exception(e) return False
def to_update_pinduoduo_xianshimiaosha_table(self, data, pipeline): tmp = _get_right_model_data(data=data, site_id=16) # print('------>>> | 待存储的数据信息为: |', tmp) print('------>>>| 待存储的数据信息为: |', tmp.get('goods_id')) params = self._get_db_update_miaosha_params(item=tmp) sql_str = 'update dbo.pinduoduo_xianshimiaosha set modfiy_time = %s, shop_name=%s, goods_name=%s, sub_title=%s, price=%s, taobao_price=%s, sku_name=%s, sku_info=%s, all_image_url=%s, property_info=%s, detail_info=%s, is_delete=%s, schedule=%s, stock_info=%s, miaosha_time=%s, miaosha_begin_time=%s, miaosha_end_time=%s where goods_id = %s' pipeline._update_table(sql_str=sql_str, params=params)
def insert_into_juanpi_xianshimiaosha_table(self, data, pipeline) -> bool: tmp = _get_right_model_data(data=data, site_id=15) print('------>>> | 待存储的数据信息为: |', tmp.get('goods_id')) params = self._get_db_insert_miaosha_params(item=tmp) res = pipeline._insert_into_table(sql_str=jp_insert_str_1, params=params) return res
def to_update_zhe_800_xianshimiaosha_table(self, data, pipeline): try: tmp = _get_right_model_data(data=data, site_id=14) except: print('此处抓到的可能是折800秒杀券所以跳过') return None print('------>>>| 待存储的数据信息为: {0}'.format(data.get('goods_id'))) params = self._get_db_update_miaosha_params(item=tmp) pipeline._update_table(sql_str=z8_update_str_2, params=params)
def update_mia_xianshimiaosha_table(self, data, pipeline): try: tmp = _get_right_model_data(data=data, site_id=20) except: print('此处抓到的可能是蜜芽秒杀券所以跳过') return None print('------>>>| 待存储的数据信息为: |', tmp.get('goods_id')) params = self._get_db_update_miaosha_params(item=tmp) pipeline._update_table(sql_str=mia_update_str_1, params=params)
def insert_into_zhe_800_pintuan_table(self, data, pipeline): try: tmp = _get_right_model_data(data=data, site_id=17) # 采集来源地(折800拼团商品) except: print('此处抓到的可能是折800拼团券所以跳过') return None print('------>>>| 待存储的数据信息为: {0}'.format(data.get('goods_id'))) params = self._get_db_insert_pintuan_params(item=tmp) pipeline._insert_into_table(sql_str=z8_insert_str_2, params=params)
def to_right_and_update_data(self, data, pipeline): try: tmp = _get_right_model_data(data=data, site_id=17) except: print('此处抓到的可能是折800拼团券所以跳过') return None print('------>>>| 待存储的数据信息为: {0}'.format(data.get('goods_id'))) params = self._get_db_update_pintuan_params(item=tmp) pipeline._update_table(sql_str=z8_update_str_3, params=params)
def to_right_and_update_pintuan_data(self, data, pipeline): try: tmp = _get_right_model_data(data=data, site_id=18) except: print('此处抓到的可能是卷皮拼团券所以跳过') return None print('------>>>| 待存储的数据信息为: |', tmp.get('goods_id')) params = self._get_db_update_pintuan_params(item=tmp) pipeline._update_table(sql_str=jp_update_str_4, params=params)
def insert_into_zhe_800_xianshimiaosha_table(self, data, pipeline): try: tmp = _get_right_model_data(data=data, site_id=14) # 采集来源地(折800秒杀商品) except: print('此处抓到的可能是折800秒杀券所以跳过') return None # print('------>>>| 待存储的数据信息为: |', tmp) print('------>>>| 待存储的数据信息为: |', tmp.get('goods_id')) params = self._get_db_insert_miaosha_params(item=tmp) pipeline._insert_into_table(sql_str=z8_insert_str_1, params=params)
def update_mogujie_pintuan_table_2(self, data, pipeline): try: tmp = _get_right_model_data(data=data, site_id=23) except: print('此处抓到的可能是蜜芽拼团券所以跳过') return None # print('------>>> | 待存储的数据信息为: |', tmp) print('------>>>| 待存储的数据信息为: |', tmp.get('goods_id')) params = self._get_db_update_pintuan_params_2(item=tmp) pipeline._update_table(sql_str=mg_update_str_4, params=params)
def to_right_and_update_data(self, data, pipeline): try: tmp = _get_right_model_data(data=data, site_id=17) except: print('此处抓到的可能是折800拼团券所以跳过') return None print('------>>>| 待存储的数据信息为: {0}'.format(data.get('goods_id'))) params = self._get_db_update_pintuan_params(item=tmp) sql_str = r'update dbo.zhe_800_pintuan set modfiy_time=%s, shop_name=%s, goods_name=%s, sub_title=%s, price=%s, taobao_price=%s, sku_name=%s, sku_Info=%s, all_image_url=%s, all_sell_count=%s, property_info=%s, detail_info=%s, schedule=%s, is_delete=%s where goods_id = %s' pipeline._update_table(sql_str=sql_str, params=params)
def to_update_zhe_800_xianshimiaosha_table(self, data, pipeline): try: tmp = _get_right_model_data(data=data, site_id=14) except: print('此处抓到的可能是折800秒杀券所以跳过') return None print('------>>>| 待存储的数据信息为: {0}'.format(data.get('goods_id'))) params = self._get_db_update_miaosha_params(item=tmp) sql_str = 'update dbo.zhe_800_xianshimiaosha set modfiy_time = %s, shop_name=%s, goods_name=%s, sub_title=%s, price=%s, taobao_price=%s, sku_name=%s, sku_Info=%s, all_image_url=%s, property_info=%s, detail_info=%s, is_delete=%s, schedule=%s, stock_info=%s, miaosha_time=%s, miaosha_begin_time=%s, miaosha_end_time=%s where goods_id = %s' pipeline._update_table(sql_str=sql_str, params=params)