def set_circle_to_fly(circle_id): set_circle_to_default(circle_id) t = int(time.time()) with get_conn("circle") as cur: query_string = "insert into dd_circle_special(circle_id, special_type, city_id, is_delete, create_time, update_time) values ({},2,0,0,{},{})".format( circle_id, t, t) cur.t_insert(query_string)
def get_regist_code(phone_number): query_string = "select val_code from dd_code where phone = {}".format( phone_number) with get_conn("dangdang") as cur: result = cur.t_select(query_string) return result[0][0]
# -*- coding:utf-8 -*- # author: songyangyang # time: 2018/10/17 from tools.sql_handler import get_conn conn = get_conn("dangdang") def create_diray(): pass def delete_diary_with_id(diary_id): with conn as cur: if isinstance(diary_id, (list, tuple)): for d_id in diary_id: query_string = "update dd_diary set is_delete=1 where diary_id={}".format( d_id) cur.t_update(query_string) else: query_string = "update dd_diary set is_delete=1 where diary_id={}".format( diary_id) cur.t_update(query_string) def get_all_diary_id_without_delete_and_sync_to_space_of_user(user_id): with conn as cur: query_string = "select diary_id from dd_diary where user_id = {} and is_delete = 0 and is_sync_space = 1".format( user_id) result = conn.t_select(query_string) format_result = []
def update_regist(email): query_string = "update dd_circle set status=1,regist_step=0,circle_type=1 where email='{}'".format( email) with get_conn("circle") as cur: cur.t_update(query_string)
def get_user_id_by_phone(phone): with get_conn("dangdang") as cur: string_query = "select user_id from dd_user where user_phone = {}".format( phone) result = cur.t_select(string_query) return result[0][0]
def set_circle_to_default(circle_id): with get_conn("circle") as cur: query_string = "update dd_circle_special set is_delete=1 where circle_id={}".format( circle_id) cur.t_update(query_string)
def set_signin_expire(scene_id, user_id): with get_conn("circle") as cur: t = int(time.time()) + 5 query_string = "update dd_circle_scene_member set signout_time={} where scene_id={} and user_id={} and is_delete=0".format( t, scene_id, user_id) cur.t_update(query_string)
def update_fans_activity_deadline(deadline, activity_id): with get_conn("circle") as cur: query_string = "update dd_circle_fans_activity set deadline = {} where activity_id = {}".format(deadline, activity_id) cur.t_update(query_string)
def update_fans_activity_member_list(create_time, activity_id, member_id): with get_conn("circle") as cur: query_string = "update dd_circle_fans_activity_member set create_time = {} where activity_id = {} and user_id = {}".format(create_time, activity_id, member_id) cur.t_update(query_string)
# -*- coding:utf-8 -*- # author: songyangyang # time: 2018/11/14 from service.circle import Circle from service.city_service import set_user_as_shop_operator, create_shop from common.get_user_profile import get_user_id_by_phone from service.city_service import create_shop, push_shop_notice from tools.sql_handler import get_conn if __name__ == "__main__": # for p in range(18900000000, 18900000021): # print(Circle.join_circle_without_person_message(get_user_id_by_phone(p), 1623375257)) # print(set_user_as_shop_operator(1623375256, 1016064, get_user_id_by_phone(p))) with get_conn("circle") as cur: q = "select first_cid, second_cid, third_cid,third_cname from dd_circle_shop_meta_categoty" # where first_cid = 10015" result = cur.t_select(q) p = 18900000089 for r in result: print(r) while True: try: print( create_shop(get_user_id_by_phone(p), 1623375255, r[0], r[1], r[2], 132, 132, "{}-{}-{}-{}".format(p, r[0], r[1], r[2]))) break except: continue p += 1
def add_square_search_suggest(suggestion, sort_num=1): t = int(time.time()) with get_conn("dangdang") as cur: query_string = "insert into dd_square_search_suggestion(suggestion,sort_num,create_time,update_time) values('{suggestion}',{sort_num},{create_time},{update_time})".format(suggestion=suggestion, sort_num=sort_num, create_time=t, update_time=t) cur.t_insert(query_string)