From 40005b717753e1091b714a7c4deedcc63e621396 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 25 Dec 2020 17:03:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B8=B8=E6=88=8F=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/FinanceController.class.php | 9 ++++++--- Application/Admin/Model/SpendModel.class.php | 17 +---------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index 946e73514..e07849218 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -740,6 +740,7 @@ class FinanceController extends ThinkController $searchGameIds = M('game', 'tab_')->where($gameWhere)->getField('id', true); $startTime = time(); + D("spend")->addSubsiteWhere($map); //游戏统计列表 if(isset($_REQUEST['export'])){ $data = D("spend")->gameStatistics($map,$searchGameIds, 0, 0); @@ -1066,15 +1067,17 @@ class FinanceController extends ThinkController if (!empty(I('user_nickname'))) { $map['game_player_name'] = array('like',I("user_nickname").'%'); } + D("Spend")->addSubsiteWhere($map); + // var_dump($map);die(); $field = "pay_order_number,FROM_UNIXTIME(payed_time) as pay_time,user_account,user_nickname,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way,sdk_version,merchant_id"; $group = ""; $order = "payed_time DESC"; if(isset($_REQUEST['export'])){ - $data = D('spend')->getSubSpendData($map,$field,$group,$order,0,0); + $data = D('spend')->getSpendData($map,$field,$group,$order,0,0); }else{ - $data = D('spend')->getSubSpendData($map,$field,$group,$order,$page,$row); + $data = D('spend')->getSpendData($map,$field,$group,$order,$page,$row); } $merchant_data = M("payment_merchant","tab_") @@ -1143,7 +1146,7 @@ class FinanceController extends ThinkController $this->assign('sumInside', $sumInside); $this->assign('sumAll', null_to_0($sumAll)); - $count = D("spend")->getSubSpendData($map,'count(*) as count',$group,$order); + $count = D("spend")->getSpendData($map,'count(*) as count',$group,$order); $this->checkListOrCountAuthRestMap($map,[]); $count = $count[0]['count']; diff --git a/Application/Admin/Model/SpendModel.class.php b/Application/Admin/Model/SpendModel.class.php index 619a5adb5..f5a605929 100644 --- a/Application/Admin/Model/SpendModel.class.php +++ b/Application/Admin/Model/SpendModel.class.php @@ -824,22 +824,7 @@ class SpendModel extends Model return $data; } - - /** - * 获取多站点查询 - */ - public function getSubSpendData($map = [], $field = '', $group = '', $order = '', $page = 0, $row = 0) - { - $query = $this->field($field)->where($map)->group($group)->order($order); - if ($row == 0) { - $data = $query->select(); - } else { - $data = $query->page($page, $row)->select(); - } - return $data; - } - - + /** * 获取统计 $map,$page,$row */