From 1528d0488ba520823c1652240da237b6b803af23 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Sun, 17 Nov 2019 14:59:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=90=8E=E5=8F=B0=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E5=BD=93=E6=9C=88=E6=96=B0=E5=A2=9E=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/PromoteController.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Application/Home/Controller/PromoteController.class.php b/Application/Home/Controller/PromoteController.class.php index b54c46875..14aed1c89 100644 --- a/Application/Home/Controller/PromoteController.class.php +++ b/Application/Home/Controller/PromoteController.class.php @@ -254,6 +254,7 @@ class PromoteController extends BaseController $grandPromote = get_pid(); $promoteId = M("promote", "tab_")->field('id')->where("chain like '%/{$grandPromote}/%' or id = {$grandPromote}")->select(); +// dump($promoteId);die(); $promoteId = array_column($promoteId, 'id'); $promoteId = implode(',', $promoteId); $whereUser['promote_id'] = ['IN', $promoteId]; @@ -283,6 +284,7 @@ class PromoteController extends BaseController $map['create_time'] = $create; } + $bindrecharge_data = M('bind_recharge', 'tab_') ->field('max(id) as id,promote_account,promote_id,create_time as ordertime,date_format(FROM_UNIXTIME(create_time),"%Y-%m-%d") AS time, floor(sum(IF(create_time ' . $pay_time . ',real_amount,0))*100) as scount, @@ -317,18 +319,17 @@ class PromoteController extends BaseController ->group('promote_id') ->select(false); - // $promote_map = "tp1.`chain` = '/'"; $promote_id = get_pid(); $promote_map = "tp1.`id` = {$promote_id}"; - $data = $spend->field('t.pid as promote_id,t.promote_account,sum(a.scount) AS count,sum(a.today) AS today,sum(a. WEEK) AS WEEK,sum(a.mounth) AS mounth') + $data = $spend->field('sum(a.scount) AS count,sum(a.today) AS today,sum(a. WEEK) AS WEEK,sum(a.mounth) AS mounth') ->join("INNER JOIN (SELECT tp2.*, tp1.id AS pid, tp1.account as promote_account FROM tab_promote tp1 LEFT JOIN tab_promote tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') where $promote_map ) AS t ON promote_id = t.id") - ->where($condition)->table('(' . $spendData . ') as a')->group('t.pid')->order('count desc,a.ordertime')->find(); + ->where($condition)->table('(' . $spendData . ') as a')->group()->order('count desc,a.ordertime')->find(); - $spendData1 = $spend->field('t.pid as promote_id,t.promote_account,sum(a.scount) AS count,sum(a.today) AS today,sum(a. WEEK) AS WEEK,sum(a.mounth) AS mounth') - ->join("INNER JOIN (SELECT tp2.*, tp1.id AS pid, tp1.account as promote_account FROM tab_promote tp1 LEFT JOIN tab_promote tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') ) AS t ON promote_id = t.id") - ->where($condition)->table('(' . $spendData . ') as a')->group('t.pid')->order('count desc,a.ordertime')->find(); + $spendData1 = $spend->field('sum(a.scount) AS count,sum(a.today) AS today,sum(a. WEEK) AS WEEK,sum(a.mounth) AS mounth') +// ->join("INNER JOIN (SELECT tp2.*, tp1.id AS pid, tp1.account as promote_account FROM tab_promote tp1 LEFT JOIN tab_promote tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') ) AS t ON promote_id = t.id") + ->where($condition)->table('(' . $spendData . ') as a')->group()->order('count desc,a.ordertime')->find(); $data['rand'] = 1; $data['count'] = $data['count'] / 100;