diff --git a/Application/Admin/Controller/QueryController.class.php b/Application/Admin/Controller/QueryController.class.php index a3d5ee4b3..a346f441f 100644 --- a/Application/Admin/Controller/QueryController.class.php +++ b/Application/Admin/Controller/QueryController.class.php @@ -1577,14 +1577,22 @@ class QueryController extends ThinkController $map['my_time'] = $_REQUEST['count_date']; } +// if ($_REQUEST['device']) { +// $map['game_name'] = ['like','%'.$_REQUEST['device'].'%']; +// } + if ($_REQUEST['device']) { - $map['game_name'] = ['like','%'.$_REQUEST['device'].'%']; +// $map['tab_spend.sdk_version'] = $_REQUEST['device']; + $spendMap['tab_spend.sdk_version'] = $_REQUEST['device']; + } + $spendMap['tab_spend.pay_status'] = 1; + //获取spend表中的数据,同时根据会长id进行group分类 $data = M('Spend','tab_') ->field("FROM_UNIXTIME(pay_time,'%Y-%m') as my_time,sum(pay_amount) as pay_amount,game_id,game_name,SUBSTRING_INDEX(`game_name`,\"(\",1) as game_names,promote_id,promote_account,company_relation,company_belong,CASE WHEN SUBSTRING_INDEX(SUBSTRING_INDEX(`chain`,\"/\",2),\"/\",-1)='' THEN promote_id ELSE SUBSTRING_INDEX(SUBSTRING_INDEX(`chain`,\"/\",2),\"/\",-1) END as root_id,pay_way ") ->join("left join tab_promote on promote_id = tab_promote.id") - ->where(['pay_status'=>1]) + ->where($spendMap) ->group("my_time,game_names,root_id,pay_way") ->order("my_time Desc") ->select(false);