diff --git a/Application/Sdk/Controller/FengHuoApi2Controller.class.php b/Application/Sdk/Controller/FengHuoApi2Controller.class.php index 877e2b19..fdd1d076 100644 --- a/Application/Sdk/Controller/FengHuoApi2Controller.class.php +++ b/Application/Sdk/Controller/FengHuoApi2Controller.class.php @@ -241,27 +241,33 @@ class FengHuoApi2Controller extends GetInfoBaseController{ // 默认排序:id降序 $order = 'login_time asc'; - $where['login_time'] = array('neq',0); +// $where['login_time'] = array('neq',0); $data = M('user_login_record','tab_') - ->field('user_id,game_name,server_name,login_time,user_account,game_player_name') + ->field('tab_user_login_record.id,tab_user_login_record.id,user_id,game_name,server_name,login_time,user_account,game_player_name,CASE WHEN promote_id = 0 THEN "官方渠道" ELSE account END as promote_account') + ->join("left join tab_promote as promote on tab_user_login_record.promote_id=promote.id") ->where($where) ->order($order) ->page($page, $row) - ->select(); - foreach ($data as $k=>$v){ - $promoteId = $v['promote_id']; - if($promoteId == 0){ - $data[$k]['promote_account'] = '官方渠道'; - }else{ - $promote_account = M('promote','tab_') - ->field('account') - ->where('id',$promoteId) - ->find(); - $data[$k]['promote_account'] = $promote_account; - } + ->select(false); + +// echo $data;die(); +// foreach ($data as $k=>$v){ +// $promoteId = $v['promote_id']; +// if($promoteId == 0){ +// $data[$k]['promote_account'] = '官方渠道'; +// }else{ +// $promote_account = M('promote','tab_') +// ->field('account') +// ->where('id',$promoteId) +// ->find(); +// +// $data[$k]['promote_account'] = $promote_account; +// } +// +// } - } +// dump($data);die(); if($data){ $result = [