room_select_sql=f'select * from `im_room` where from_id in {user_list} and cate_id = {searchtData.brandId} and status = 1 and room_type != 2 and is_ignore = 0 and site_id = {searchtData.shopId}'
room_select_sql=f'select * from `im_room` where from_id in {user_list} and cate_id = {searchtData.brandId} and status = 1 and room_type != 2 and is_ignore = 0 '
whatsapp_select_sql=f'select * from `whatsapp_phone` where waba_id in {whatsapp_id_list} and status = "CONNECTED" and brand_id = {shopifyIntegrationData.brandId}'
iflen(whatsapp_id_list)==1:
whatsapp_select_sql=f'select * from `whatsapp_phone` where waba_id = {whatsapp_id_list[0]} and status = "CONNECTED" and brand_id = {shopifyIntegrationData.brandId}'
else:
whatsapp_select_sql=f'select * from `whatsapp_phone` where waba_id in {whatsapp_id_list} and status = "CONNECTED" and brand_id = {shopifyIntegrationData.brandId}'
facebook_select_sql=f'select * from im_facebook_channel_conf where site_id in {facebook_id_list} and is_connected = 1 and ins_relate = "" and expires_at > {int(timeStamp)}'
iflen(facebook_id_list)==1:
facebook_select_sql=f'select * from im_facebook_channel_conf where site_id = {facebook_id_list[0]} and is_connected = 1 and ins_relate = "" and expires_at > {int(timeStamp)}'
else:
facebook_select_sql=f'select * from im_facebook_channel_conf where site_id in {facebook_id_list} and is_connected = 1 and ins_relate = "" and expires_at > {int(timeStamp)}'