From 256545a59a98d1a909706d1af36ce3bfc89b2bd2 Mon Sep 17 00:00:00 2001 From: chenzhi <“chenzhi063@qq.com> Date: Thu, 21 Nov 2019 16:57:38 +0800 Subject: [PATCH] 123 --- .../Admin/Controller/PlatformController.class.php | 14 ++++++-------- .../Admin/Controller/SpendController.class.php | 3 +-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Application/Admin/Controller/PlatformController.class.php b/Application/Admin/Controller/PlatformController.class.php index 2dcfaf768..94d91e50e 100644 --- a/Application/Admin/Controller/PlatformController.class.php +++ b/Application/Admin/Controller/PlatformController.class.php @@ -417,8 +417,6 @@ class PlatformController extends ThinkController $this->assign('total', $total); $this->display(); } - - function promotepay_statistics($p = 0) { $page = intval($p); @@ -451,7 +449,7 @@ class PlatformController extends ThinkController $today = total(1); $week = total(2); $mounth = total(3); - $map1['pay_way'] = $map['pay_way'] = array('gt', 0); + // $map1['pay_way'] = $map['pay_way'] = array('gt', 0); $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, @@ -495,8 +493,8 @@ class PlatformController extends ThinkController floor(sum(IF(pay_time ' . $week . ',pay_amount,0))*100) as week, floor(sum(IF(pay_time ' . $mounth . ',pay_amount,0))*100) as mounth') ->where($map) - ->union(' (' . $bindrecharge_data . ') ') - ->union(' (' . $deposit_data . ') ') + // ->union(' (' . $bindrecharge_data . ') ') + // ->union(' (' . $deposit_data . ') ') ->group('promote_id') ->select(false); } @@ -506,10 +504,10 @@ class PlatformController extends ThinkController unset($_REQUEST['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') - ->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 or promote_id = t.pid") - ->where($condition)->table('(' . $data . ') as a')->group('t.pid')->order('count desc,a.ordertime')->select(); + ->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, '/%') OR tp1.id = tp2.id where $promote_map ) AS t ON promote_id = t.id or promote_id = t.pid") + ->where($condition)->table('(' . $data . ') as a')->group('t.pid')->order('count desc,a.ordertime')->select(false); $count = count($data); - // dump($condition);die; + foreach ($data as $key => $value) { static $i = 0; $i++; diff --git a/Application/Admin/Controller/SpendController.class.php b/Application/Admin/Controller/SpendController.class.php index 1d24c85d9..945cc790f 100644 --- a/Application/Admin/Controller/SpendController.class.php +++ b/Application/Admin/Controller/SpendController.class.php @@ -92,7 +92,7 @@ class SpendController extends ThinkController } else { $order = ' pay_time desc '; } - + if (intval(($endTime + 1) - $startTime) / (24 * 3600) <= 31) { $map1 = $map; $map1['pay_status'] = 1; @@ -100,7 +100,6 @@ class SpendController extends ThinkController $map = '1 = 2'; $map1 = $map; } - $total = null_to_0(D(self::model_name)->where($map1)->sum('pay_amount')); $ttotal = null_to_0(D(self::model_name)->where('pay_time' . total(1))->where(array('pay_status' => 1))->sum('pay_amount')); $ytotal = null_to_0(D(self::model_name)->where('pay_time' . total(5))->where(array('pay_status' => 1))->sum('pay_amount'));