From 3741b0d27f6ec739245cd0f6918aaddc3cc66e67 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Tue, 14 Jan 2020 19:40:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=82=E5=9C=BA=E7=BB=93=E7=AE=97=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/QueryController.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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);