tablePrefix ='tab_'; /* 执行构造方法 */ parent::__construct($name, $tablePrefix, $connection); } /** * 消费列表 * @author 鹿文学 */ public function lists($p=1) { } /** * 获取小号列表通过游戏 * @param integer $game_id 游戏编号 * @return array * @author 鹿文学 */ public function get_small_list_by_game($game_id=0) { if(is_numeric($game_id) && $game_id > 0) { $user = D('User')->getLoginInfo(); $lists = $this->alias('s')->field('s.small_id,s.small_account,u.cumulative,sum(pay_amount) as pay_amount') ->join('tab_user as u on(u.id=s.small_id and u.lock_status=1 and puid='.$user['user_id'].') ') ->where(['s.game_id'=>$game_id,'s.pay_status'=>1])->group('s.small_id')->select(); file_put_contents(dirname(__FILE__) .'/spend_sql.txt',json_encode([$this->getLastSql()])); return $lists; } else { return ''; } } }