From f0829e84ccedcccbf90ae834aab6ca386b2a41b4 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 29 Dec 2020 20:59:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/ExportController.class.php | 5 ++++- .../Admin/Controller/PlatformController.class.php | 11 ++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 1cf512b64..39cce7e7b 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -3450,7 +3450,7 @@ class ExportController extends Controller $today = total(1); $week = total(2); $mounth = total(3); - + D("Spend")->addSubsiteWhere($map,"tab_spend"); $data = $spend ->field('tab_game.relation_game_name as game_name, tab_game.relation_game_id as game_id,date_format(FROM_UNIXTIME(pay_time),"%Y-%m-%d") AS time, sum(pay_amount) as count') ->where($map) ->where($map) @@ -3471,6 +3471,7 @@ class ExportController extends Controller //unset($_REQUEST['game_type']); } setPowerPromoteIds($map2); + D("Spend")->addSubsiteWhere($map2,"tab_spend"); $data2 = $spend ->field('tab_game.relation_game_id as game_id, sum(IF(pay_time ' . $today . ',pay_amount,0)) as today, sum(IF(pay_time ' . $week . ',pay_amount,0)) as week, @@ -3660,6 +3661,7 @@ class ExportController extends Controller $today = total(1); $week = total(2); $mounth = total(3); + D("Spend")->addSubsiteWhere($map); $data = $spend ->field('pay_way,date_format(FROM_UNIXTIME(pay_time),"%Y-%m-%d") AS time, sum(pay_amount) as count') ->where($map) @@ -3670,6 +3672,7 @@ class ExportController extends Controller $map2 = array(); $map2['pay_status'] = 1; setPowerPromoteIds($map2); + D("Spend")->addSubsiteWhere($map2); $data2 = $spend ->field('pay_way, sum(IF(pay_time ' . $today . ',pay_amount,0)) as today, diff --git a/Application/Admin/Controller/PlatformController.class.php b/Application/Admin/Controller/PlatformController.class.php index 599f86fee..90707d774 100644 --- a/Application/Admin/Controller/PlatformController.class.php +++ b/Application/Admin/Controller/PlatformController.class.php @@ -106,6 +106,7 @@ class PlatformController extends ThinkController "pay_time"=>["between",$yearMap], "pay_status"=>1 ]; + D("Spend")->addSubsiteWhere($map); $Payamount = M("Spend","tab_")->field("sum(pay_amount) pay_amount,FROM_UNIXTIME(`pay_time`, '%Y-%m') paytime")->where($map)->group("paytime")->select(); if(empty($Payamount)) return ; foreach ($Payamount as $v) { @@ -470,9 +471,9 @@ class PlatformController extends ThinkController $today = total(1); $week = total(2); $mounth = total(3); - + D("Spend")->addSubsiteWhere($map,"tab_spend"); $data = $spend - ->field('tab_game.relation_game_name as game_name, tab_game.relation_game_id as game_id,date_format(FROM_UNIXTIME(pay_time),"%Y-%m-%d") AS time, sum(pay_amount) as count') ->where($map) + ->field('tab_game.relation_game_name as game_name, tab_game.relation_game_id as game_id,date_format(FROM_UNIXTIME(pay_time),"%Y-%m-%d") AS time, sum(pay_amount) as count') ->where($map) ->join('tab_game on tab_game.id = tab_spend.game_id', 'left') ->group('tab_game.relation_game_id') @@ -492,6 +493,7 @@ class PlatformController extends ThinkController //unset($_REQUEST['game_type']); } setPowerPromoteIds($map2); + D("Spend")->addSubsiteWhere($map2,"tab_spend"); $data2 = $spend ->field('tab_game.relation_game_id as game_id, sum(IF(pay_time ' . $today . ',pay_amount,0)) as today, sum(IF(pay_time ' . $week . ',pay_amount,0)) as week, @@ -681,6 +683,7 @@ class PlatformController extends ThinkController $today = total(1); $week = total(2); $mounth = total(3); + D("Spend")->addSubsiteWhere($map); $data = $spend ->field('pay_way,date_format(FROM_UNIXTIME(pay_time),"%Y-%m-%d") AS time, sum(pay_amount) as count') ->where($map) @@ -691,6 +694,7 @@ class PlatformController extends ThinkController $map2 = array(); $map2['pay_status'] = 1; setPowerPromoteIds($map2); + D("Spend")->addSubsiteWhere($map2); $data2 = $spend ->field('pay_way, sum(IF(pay_time ' . $today . ',pay_amount,0)) as today, @@ -1070,6 +1074,7 @@ class PlatformController extends ThinkController //为数据权限添加 setPowerPromoteIds($map, 'tp1.id'); } + D("Spend")->addSubsiteWhere($map,"s"); $data = M('promote', 'tab_')->alias('tp1') ->field('tp1.account as promote_account,tp1.id,g.relation_game_id,g.relation_game_name, @@ -1260,7 +1265,7 @@ class PlatformController extends ThinkController function day_data($model = 'User', $column1 = array(), $column2 = 'count') { //今日本周本月不跟随选择的实现变动 只以当前日期为基准 - $table = M($model, 'tab_'); + $table = SM($model, 'tab_'); $today = total(1); $week = total(2); $mounth = total(3);