Example #1
0
 def fix_stock_user(self, number=9999):
     """
     修改工位上的票数(全部的工位)
     :return:
     """
     base_mysql.execute('update lot_stock_user set stock_nums=%s',
                        params=(number))
Example #2
0
 def delete_user_auth(self, mobile):
     """
     清除用户实名认证信息
     :param mobile:
     :return:
     """
     base_mysql.execute('delete from lot_user_auth where mobile=%s',
                        params=(mobile))
Example #3
0
 def delete_order_details(self, order_id):
     """
     删除用户的购彩记录
     :param order_id:
     :return:
     """
     base_mysql.execute("delete from lot_order_detail where order_id=%s",
                        params=(order_id))
Example #4
0
 def delete_account_details(self, user_id):
     """
     删除用户消费记录
     :param user_id:
     :return:
     """
     base_mysql.execute('delete from lot_account_detail where user_id=%s',
                        params=(user_id))
Example #5
0
 def delete_lot_order(self, user_id):
     """
     删除订单
     :param user_id:
     :return:
     """
     base_mysql.execute('delete from lot_order where user_id=%s',
                        params=(user_id))
Example #6
0
 def delete_bind_card(self, auth_id):
     """
     删除用户绑卡信息
     :param auth_id:
     :return:
     """
     base_mysql.execute('delete from lot_user_binding where auth_id=%s',
                        params=(auth_id))
Example #7
0
 def clean_user_anchor_group(self):
     # 清除用户主播团信息
     mysql_helper.execute('delete from anchor_group where user_id=%s', params=(self.user_id))
     mysql_helper.execute('delete from anchor_group_anchor where user_id=%s', params=(self.user_id))
     mysql_helper.execute('delete from anchor_group_rank where user_id=%s', params=(self.user_id))
     mysql_helper.execute('delete from anchor_group_log where user_id=%s', params=(self.user_id))
     mysql_helper.execute('delete from anchor_group_account_log where user_id=%s', params=(self.user_id))
     return self
Example #8
0
 def get_user_contribution_details(self, guard=False):
     # 获取用户贡献值详情
     if guard:
         details = mysql_helper.execute('select * from user_contribution where user_id=%s and behavior=%s',params=(self.user_id, 'behavior_buy_guard_fruit'))
         return details
     else:
         details = mysql_helper.execute('select * from user_contribution where user_id=%s order by id desc', params=(self.user_id))
         return details
Example #9
0
 def delete_user_withdraw_log(self, auth_id):
     """
     删除用户提现记录
     :param auth_id:
     :return:
     """
     base_mysql.execute('delete from lot_present_record where auth_id=%s',
                        params=(auth_id))
Example #10
0
 def fix_user_mobile(self, auth_id, mobile):
     """
     修改用户的绑定手机号
     :param auth_id:
     :param mobile:
     :return:
     """
     base_mysql.execute('update lot_user_auth set mobile=%s where id=%s',
                        params=(mobile, auth_id))
Example #11
0
 def send_prize_after(self, image_url, detail_id, is_upload=1):
     """
     手动开奖完成后,向数据库中写入中奖图片地址并标志为已上传
     :param image_url:
     :param detail_id:
     :return:
     """
     base_mysql.execute(
         "update lot_order_detail set route=%s,is_upload=%s where id=%s",
         params=(image_url, is_upload, detail_id))
Example #12
0
 def fix_user_withdraw_amount(self, auth_id, amount):
     """
     修改用户提现额度
     :param auth_id:
     :param amount:
     :return:
     """
     base_mysql.execute(
         'update lot_user_auth set amount_of_cash=%s where id=%s',
         params=(amount, auth_id))
Example #13
0
 def reset_station(self, station_num):
     """
     重置工位状态
     :param station_num:
     :return:
     """
     base_mysql.execute(
         'update lot_station set station_status=3 where number=%s',
         params=(station_num))
     return self
Example #14
0
 def fix_user_money(self, balance, user_id):
     """
     修改用户金额
     :param money:
     :return:
     """
     auth_id = base_mysql.execute(
         'select auth_id from lot_user_info where id=%s', params=(user_id))
     base_mysql.execute(
         'update lot_account set balance=%s where auth_id=%s',
         params=(balance, auth_id['auth_id']))
Example #15
0
 def reset_window(self, window_id, room_id):
     """
     重置助理窗口
     :param window_id:
     :param room_id:
     :return:
     """
     if window_id == None:
         base_mysql.execute(
             'update lot_live_window set status=3 where room_id=%s',
             params=(room_id))
     else:
         base_mysql.execute(
             'update lot_live_window set status=3 where num=%s and room_id=%s',
             params=(window_id, room_id))
         logger.info('更新窗口状态成功')
Example #16
0
 def get_anchor_room_supervisor_details(self):
     # 获取直播间内管理员列表
     details = mysql_helper.execute('select * from anchor_room_supervisor where user_id=%s', params=(self.user_id))
     if details:
         return details
     else:
         return None
Example #17
0
 def delete_user(self, union_id):
     """
     删除用户信息
     :param union_id:
     :return:
     """
     try:
         user_id = base_mysql.execute(
             'select id from lot_user_info where union_id=%s',
             params=(union_id))['id']
         base_mysql.execute('delete from lot_user_info where union_id=%s',
                            params=(union_id))
         base_mysql.execute('delete from lot_account where user_id=%s',
                            params=user_id)
     except:
         logger.error('Delete user failed!')
Example #18
0
 def fix_user_money(self, balance, nickname=settings.TEST_NICKNAME, type=1):
     """
     修改用户金额
     :param money:
     :return:
     """
     auth_id = base_mysql.execute(
         'select auth_id from lot_user_info where nickname=%s',
         params=(nickname))
     if type == 3:
         base_mysql.execute(
             'update lot_account set balance=%s where auth_id=%s',
             params=(balance, auth_id['auth_id']))
     else:
         base_mysql.execute(
             'update lot_account set balance=%s where auth_id=%s and account_type=%s',
             params=(balance, auth_id['auth_id'], type))
Example #19
0
 def get_bank_list(self):
     """
     获取银行列表
     :return:
     """
     bank_list = base_mysql.execute('select * from lot_bank',
                                    is_fetchone=False)
     return bank_list
Example #20
0
    def delete_lot_order(self, user_id):
        """
        删除订单
        :param user_id:
        :return:
        """
        try:
            order_id = base_mysql.execute(
                'select id from lot_order where user_id=%s', params=(user_id))

            base_mysql.execute(
                'delete from lot_order_detail where order_id=%s',
                params=(order_id['id']))

            base_mysql.execute('delete from lot_order where user_id=%s',
                               params=(user_id))
        except Exception as e:
            logger.error(e)
Example #21
0
 def get_order_id(self, user_id):
     """
     获取订单order_id
     :param user_id:
     :return:
     """
     order_id = base_mysql.execute(
         'select id from lot_order where user_id=%s', params=(user_id))
     return order_id['id']
Example #22
0
 def get_user_auth(self, auth_id):
     """
     获取用户lot_user_auth信息
     :param auth_id:
     :return:
     """
     auth = base_mysql.execute('select * from lot_user_auth where id=%s',
                               params=(auth_id))
     return auth
Example #23
0
 def get_lottery_detail(self, id):
     """
     获取某ID的彩种信息
     :param id:
     :return:
     """
     one_lottery = base_mysql.execute(
         'select * from lot_lottery where id=%s ', params=(id))
     return one_lottery
Example #24
0
 def get_order_detail(self, user_id):
     """
     获取订单信息
     :param user_id:
     :return:
     """
     order_detail = base_mysql.execute(
         'select * from lot_order where user_id=%s', params=(user_id))
     return order_detail
Example #25
0
 def get_user_details(self, nickname=settings.TEST_NICKNAME):
     """
     获取用户信息
     :param union_id:
     :return:
     """
     details = base_mysql.execute(
         'select * from lot_user_info where nickname=%s', params=(nickname))
     return details
Example #26
0
 def get_province_name(self, id):
     """
     获取省份的name
     :param id:
     :return:
     """
     province_name = base_mysql.execute(
         "select name from lot_province where id=%s", params=id)
     return province_name
Example #27
0
 def get_user_details(self, union_id):
     """
     获取用户信息
     :param union_id:
     :return:
     """
     details = base_mysql.execute(
         'select * from lot_user_info where union_id=%s', params=(union_id))
     return details
Example #28
0
 def get_lot_account_info(self, user_id):
     """
     获取用户account信息
     :param union_id:
     :return:
     """
     account_info = base_mysql.execute(
         'select * from lot_account where user_id = %s', params=(user_id))
     return account_info
Example #29
0
 def get_lot_user_info(self, id):
     """
     获取用户user_info信息
     :param id:
     :return:
     """
     user_info = base_mysql.execute(
         'select * from lot_user_info where id = %s', params=(id))
     return user_info
Example #30
0
 def get_single_query_list(self):
     """
     获取等待分配窗口信息用户列表
     :return:
     """
     single_list = base_mysql.execute(
         'select distinct user_id from (select * from lot_order where project_id is null and '
         '(order_status = 0 or order_status = 1)) t limit 0,5',
         is_fetchone=False)
     return single_list