From d07f6177757b0181257d52a74e824b25f2e68579 Mon Sep 17 00:00:00 2001
From: chenxiaojun <956334972@qq.com>
Date: Mon, 2 Dec 2019 11:36:55 +0800
Subject: [PATCH 1/7] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=AE=A1=E7=90=86-=E8=AE=A2=E5=8D=95?=
=?UTF-8?q?=E6=9F=A5=E8=AF=A2|=E6=95=B0=E6=8D=AE=E7=AE=A1=E7=90=86-?=
=?UTF-8?q?=E5=85=85=E5=80=BC=E7=BB=9F=E8=AE=A1|=E8=B4=A2=E5=8A=A1?=
=?UTF-8?q?=E7=AE=A1=E7=90=86-=E7=BB=93=E7=AE=97=E6=98=8E=E7=BB=86--?=
=?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=90=88=E8=AE=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controller/FinanceController.class.php | 6 +++++
.../Home/Controller/QueryController.class.php | 17 ++++++++++++++
.../View/default/Finance/settlementDtl.html | 22 +++++++++++++++++--
.../Home/View/default/Query/recharge.html | 19 +++++++++++++---
.../View/default/Query/userRecharges.html | 14 ++++++++++++
5 files changed, 73 insertions(+), 5 deletions(-)
diff --git a/Application/Home/Controller/FinanceController.class.php b/Application/Home/Controller/FinanceController.class.php
index f8b4e8ceb..b9d6d174f 100644
--- a/Application/Home/Controller/FinanceController.class.php
+++ b/Application/Home/Controller/FinanceController.class.php
@@ -182,6 +182,7 @@ class FinanceController extends BaseController
$parameter['endtime'] = $initEndTime;
$data = [];
+ $total = [];
$count = 0;
if (intval($endTime - $begTime) / (24 * 3600) <= 31) {
$withdrawIds = [];
@@ -222,6 +223,10 @@ class FinanceController extends BaseController
->page($page, $row)
->select();
$count = $model->where($map)->count();
+ $total = $model->field('sum(pay_amount) as pay_amount,pay_way,sum(if(selle_ratio >= 0,selle_ratio * pay_amount,0)) as income')
+ ->where($map)
+ ->find();
+ $total['income'] = bcdiv($total['income'], 100, 2);
//提现状态
if (empty($withdrawIds)) {
@@ -264,6 +269,7 @@ class FinanceController extends BaseController
$this->assign('listData', $data);
$this->assign('count', $count);
+ $this->assign('total', $total);
$this->assign('initBegTime', $initBegTime);
$this->assign('initEndTime', $initEndTime);
$this->assign('_page', $page);
diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php
index 908a5c82e..f7e04a452 100644
--- a/Application/Home/Controller/QueryController.class.php
+++ b/Application/Home/Controller/QueryController.class.php
@@ -91,6 +91,7 @@ class QueryController extends BaseController
$data = [];
$count = 0;
+ $income = '0.00';
if (intval($endTime - $begTime) / (24 * 3600) <= 31) {
$data = M('Spend', 'tab_')
->field('tab_spend.*,tab_promote.account as pro_account,tab_promote.real_name as pro_real_name,tab_promote.chain as chain')
@@ -105,6 +106,14 @@ class QueryController extends BaseController
->join('tab_game on tab_spend.game_id = tab_game.id')
->where($map)
->count();
+
+ $income = M('Spend', 'tab_')
+ ->field('sum(tab_spend.pay_amount) as income')
+ ->join('tab_game on tab_spend.game_id = tab_game.id')
+ ->join('left join tab_promote on tab_spend.promote_id = tab_promote.id')
+ ->where($map)
+ ->order('tab_spend.id desc')
+ ->find()['income'];
}
if (!empty($data)) {
foreach ($data as &$list) {
@@ -177,6 +186,7 @@ class QueryController extends BaseController
}
$this->assign('listData', $data);
$this->assign('count', $count);
+ $this->assign('income', $income);
$this->assign('initBegTime', $initBegTime);
$this->assign('initEndTime', $initEndTime);
$this->assign('setdate', date("Y-m-d"));
@@ -1736,6 +1746,7 @@ class QueryController extends BaseController
$records = [];
$pagination = '';
$count = 0;
+ $total = [];
if (intval($endTime - $begTime) / (24 * 3600) <= 31) {
$map['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'];
$ids = M('promote', 'tab_')->where($map)->getField('id', true);
@@ -1824,6 +1835,11 @@ class QueryController extends BaseController
$query = M()->alias('record')
->table($subQuery)
->order($orderBy);
+ $total = M('user_play_data_count', 'tab_')->alias('uc')
+ ->field($fieldUC)
+ ->join('tab_user_play_info as ui on ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id')
+ ->where($map)
+ ->find();
list($records, $pagination, $count) = $this->paginate($query);
@@ -1839,6 +1855,7 @@ class QueryController extends BaseController
$this->assign('records', $records);
$this->assign('pagination', $pagination);
$this->assign('count', $count);
+ $this->assign('total', $total);
$this->assign('initBegTime', $initBegTime);
$this->assign('initEndTime', $initEndTime);
$this->assign('sort', $sort);
diff --git a/Application/Home/View/default/Finance/settlementDtl.html b/Application/Home/View/default/Finance/settlementDtl.html
index aefcaf46a..d438f9fca 100644
--- a/Application/Home/View/default/Finance/settlementDtl.html
+++ b/Application/Home/View/default/Finance/settlementDtl.html
@@ -164,11 +164,11 @@
{$vo.promote_account} |
{$vo.pay_amount} |
- 0 |
+ 0.00 |
{$vo.pay_amount} |
{$vo.pay_amount} |
- 0 |
+ 0.00 |
{$vo.selle_ratio}%|{$vo.selle_ratio}% |
{$vo.income} |
@@ -176,6 +176,24 @@
{$vo.selle_status} |
+
+ 合计} |
+ -- |
+ -- |
+ -- |
+ {$total.pay_amount} |
+
+ 0.00 |
+ {$total.pay_amount} |
+
+ {$total.pay_amount} |
+ 0.00 |
+
+ -- |
+ {$total.income} |
+ -- |
+ -- |
+
diff --git a/Application/Home/View/default/Query/recharge.html b/Application/Home/View/default/Query/recharge.html
index d7a658ae1..b59d47b23 100644
--- a/Application/Home/View/default/Query/recharge.html
+++ b/Application/Home/View/default/Query/recharge.html
@@ -196,9 +196,9 @@
{$vo.game_name} |
{$vo.server_name} |
{$vo.game_player_name} |
- {$vo.p_p_pro_account}({$vo.p_p_pro_real_name}) |
- {$vo.p_pro_account}({$vo.p_pro_real_name}) |
- {$vo.pro_account}({$vo.pro_real_name}) |
+ {$vo.p_p_pro_account}({$vo.p_p_pro_real_name}) |
+ {$vo.p_pro_account}({$vo.p_pro_real_name}) |
+ {$vo.pro_account}({$vo.pro_real_name}) |
{$vo.pay_time|date='Y-m-d H:i:s',###} |
@@ -206,6 +206,19 @@
+
+ 合计 |
+ -- |
+ -- |
+ {$income} |
+ -- |
+ -- |
+ -- |
+ -- |
+ -- |
+ -- |
+ -- |
+
diff --git a/Application/Home/View/default/Query/userRecharges.html b/Application/Home/View/default/Query/userRecharges.html
index 98b80d789..67a7f0889 100644
--- a/Application/Home/View/default/Query/userRecharges.html
+++ b/Application/Home/View/default/Query/userRecharges.html
@@ -167,6 +167,20 @@
{$record.promote_account} |
+
+ 合计 |
+ -- |
+ -- |
+ -- |
+ -- |
+ -- |
+ {$total.recharge_cost} |
+ {$total.recharge_count} |
+ {$total.recharge_cost_today} |
+ -- |
+ -- |
+ -- |
+
From ae8daa1c45d8fa61a585c6c438c968039b7e3a7b Mon Sep 17 00:00:00 2001
From: chenxiaojun <956334972@qq.com>
Date: Mon, 2 Dec 2019 11:41:25 +0800
Subject: [PATCH 2/7] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=AE=A1=E7=90=86-=E8=AE=A2=E5=8D=95?=
=?UTF-8?q?=E6=9F=A5=E8=AF=A2|=E6=95=B0=E6=8D=AE=E7=AE=A1=E7=90=86-?=
=?UTF-8?q?=E5=85=85=E5=80=BC=E7=BB=9F=E8=AE=A1|=E8=B4=A2=E5=8A=A1?=
=?UTF-8?q?=E7=AE=A1=E7=90=86-=E7=BB=93=E7=AE=97=E6=98=8E=E7=BB=86--?=
=?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=90=88=E8=AE=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Home/View/default/Finance/settlementDtl.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Application/Home/View/default/Finance/settlementDtl.html b/Application/Home/View/default/Finance/settlementDtl.html
index d438f9fca..70b0f92af 100644
--- a/Application/Home/View/default/Finance/settlementDtl.html
+++ b/Application/Home/View/default/Finance/settlementDtl.html
@@ -177,7 +177,7 @@
- 合计} |
+ 合计 |
-- |
-- |
-- |
From 245e07fc3fcae5015332ca4b8cd9484ccef6c818 Mon Sep 17 00:00:00 2001
From: zhengyongxing
Date: Mon, 2 Dec 2019 13:57:15 +0800
Subject: [PATCH 3/7] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=BB=9F=E8=AE=A1?=
=?UTF-8?q?=E8=84=9A=E6=9C=ACbug=E4=BF=AE=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Admin/Controller/StatController.class.php | 2 +-
Application/Admin/Controller/TimingController.class.php | 9 ++++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/Application/Admin/Controller/StatController.class.php b/Application/Admin/Controller/StatController.class.php
index 3f3ee2da9..e6a7d1252 100644
--- a/Application/Admin/Controller/StatController.class.php
+++ b/Application/Admin/Controller/StatController.class.php
@@ -1375,7 +1375,7 @@ class StatController extends ThinkController
$model = M('device_statistics','tab_');
if ($type == 0) {
- $return = $model->sum('new_device');
+ $return = $model->where(array('time'=>array('neq',0)))->sum('new_device');
// $return = $device->all_device();
} else if($type == 1) {
$return = $model->where(['time'=>array('between',[$todaystart,$todaystart+86399])])->sum('new_device');
diff --git a/Application/Admin/Controller/TimingController.class.php b/Application/Admin/Controller/TimingController.class.php
index 5cd2b799a..2a089ff0e 100644
--- a/Application/Admin/Controller/TimingController.class.php
+++ b/Application/Admin/Controller/TimingController.class.php
@@ -141,9 +141,15 @@ class TimingController extends AdminController {
//当日新增设备
$newSql = M('device_record','tab_')->field('min(create_time) as create_time,model,unique_code,id')->where(['version'=>1])->group('unique_code')->select(false);
$data['new_device'] = M('device_record','tab_')->table('(' . $newSql . ') as a')->where(['create_time'=>array('between',[$startTime,$startTime+86399])])->order('create_time')->count();
+ $data['time'] = $startTime;
echo $data['new_device'].' ';
+ $duration = $this->duration(['create_time'=>array('between',[$startTime-86400*7,$startTime-1])]);
+ $newSqls = M('device_record','tab_')->field('min(create_time) as create_time,model,unique_code,id')->group('unique_code')->select(false);
+ $data['duration7'] = ($duration/M('device_record','tab_')->table('(' . $newSqls . ') as a')->where(['create_time'=>array('between',[$startTime-86400*7,$startTime-1])])->order('create_time')->count())/7;
+ $data['version'] = 1;
+
$getStatistics = M('device_statistics','tab_')->where(['time'=>$startTime,'version'=>1])->find();
echo "\n";
if (!$getStatistics) {
@@ -151,13 +157,14 @@ class TimingController extends AdminController {
} else {
M('device_statistics','tab_')->where(['time'=>$startTime,'version'=>1])->save($data);
}
-
+ $data['duration7'] = 0;
echo date("Y-m-d",$startTime).' 苹果 ';
//当日新增设备
$newSql = M('device_record','tab_')->field('min(create_time) as create_time,model,unique_code,id')->where(['version'=>2])->group('unique_code')->select(false);
$data['new_device'] = M('device_record','tab_')->table('(' . $newSql . ') as a')->where(['create_time'=>array('between',[$startTime,$startTime+86399])])->order('create_time')->count();
echo $data['new_device'].' ';
+ $data['version'] = 2;
$getStatistics = M('device_statistics','tab_')->where(['time'=>$startTime,'version'=>2])->find();
echo "\n";
From b4e14251ce8f57549f69ec0993ea682fead66cd9 Mon Sep 17 00:00:00 2001
From: sunke <18850253506@163.com>
Date: Mon, 2 Dec 2019 14:14:43 +0800
Subject: [PATCH 4/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=90=88=E8=AE=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controller/DownloadController.class.php | 71 ++++++++++++++++++-
1 file changed, 69 insertions(+), 2 deletions(-)
diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php
index d9104acdd..7988cdcd0 100644
--- a/Application/Home/Controller/DownloadController.class.php
+++ b/Application/Home/Controller/DownloadController.class.php
@@ -2501,7 +2501,12 @@ class DownloadController extends BaseController {
$data = $model->field('pay_order_number,game_name,user_account,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_time,selle_status,pay_status,withdraw_id')
->where($map)
->order('id desc')
- ->select();
+ ->select();
+ $total = [];
+ $total = $model->field('sum(pay_amount) as pay_amount,pay_way,sum(if(selle_ratio >= 0,selle_ratio * pay_amount,0)) as income')
+ ->where($map)
+ ->find();
+ $total['income'] = bcdiv($total['income'], 100, 2);
//提现状态
$withdrawIds = [];
foreach ($data as $key => $value) {
@@ -2548,6 +2553,24 @@ class DownloadController extends BaseController {
}
}
+ $allData['pay_order_number'] = '合计';
+ $allData['game_name'] = '--';
+ $allData['user_account'] = '--';
+ $allData['promote_account'] = '--';
+ $allData['pay_amount'] = $total['pay_amount'];
+ if($total['pay_way'] == -1) {
+ $allData['pay_amount_zhi'] = '0.00';
+ $allData['pay_amount_nei'] = $total['pay_amount'];
+ }else {
+ $allData['pay_amount_zhi'] = $total['pay_amount'];
+ $allData['pay_amount_nei'] = '0.00';
+ }
+ $allData['selle_ratio'] = '--';
+ $allData['selle_ratio'] = '--';
+ $allData['income'] = $total['income'];
+ $allData['pay_time'] = '--';
+ $allData['selle_status'] = '--';
+ $data[] = $allData;
$xlsData = $data;
$this->exportExcel($xlsName, $xlsCell, $xlsData,$id);
@@ -2895,6 +2918,12 @@ class DownloadController extends BaseController {
$roles = M()->alias('record')
->table($subQuery)
->select();
+ $total = [];
+ $total = M('user_play_data_count', 'tab_')->alias('uc')
+ ->field($fieldUC)
+ ->join('tab_user_play_info as ui on ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id')
+ ->where($map)
+ ->find();
foreach ($roles as $role) {
$records[] = [
'user_account' => encryption($role['user_account']),
@@ -2915,7 +2944,22 @@ class DownloadController extends BaseController {
'unlogin_day' => intval((strtotime(date('Y-m-d 00:00:00')) - strtotime(date('Y-m-d 00:00:00', $role['play_time']))) / (24 * 3600))
];
}
-
+ $allData['user_account'] = '合计';
+ $allData['game_name'] = '--';
+ $allData['role_name'] = '--';
+ $allData['role_id'] = '--';
+ $allData['role_level'] = '--';
+ $allData['server_id'] = '--';
+ $allData['server_name'] = '--';
+ $allData['recharge_cost'] = $total['recharge_cost'];
+ $allData['recharge_count'] = $total['recharge_count'];
+ $allData['recharge_cost_today'] = $total['recharge_cost_today'];
+ $allData['play_time'] = '--';
+ $allData['play_ip'] = '--';
+ $allData['promote_id'] = '--';
+ $allData['promote_account'] = '--';
+ $allData['sdk_version'] = '--';
+ $allData['unlogin_day'] = '--';
$xlsData = [];
foreach ($records as $key1 => $value1) {
$value1['user_account'] = $this->encryption($value1['user_account']);
@@ -2927,6 +2971,7 @@ class DownloadController extends BaseController {
}
$xlsData[] = $value1;
}
+ $xlsData[] = $allData;
$this->exportExcel($xlsName, $xlsCell, $xlsData,$id);
}
@@ -3027,6 +3072,28 @@ class DownloadController extends BaseController {
ob_flush();
flush();
}
+ $income = '0.00';
+ $income = M('Spend', 'tab_')
+ ->field('sum(tab_spend.pay_amount) as income')
+ ->join('tab_game on tab_spend.game_id = tab_game.id')
+ ->join('left join tab_promote on tab_spend.promote_id = tab_promote.id')
+ ->where($map)
+ ->order('tab_spend.id desc')
+ ->find()['income'];
+ $csvData1["user_account"] = "合计";
+ $csvData1["order_number"] = "--";
+ $csvData1["pay_amount"] = $income;
+ $csvData1["pay_way"] = "--";
+ $csvData1["game_name"] = "--";
+ $csvData1["server_name"] = "--";
+ $csvData1["game_player_name"] = "--";
+ $csvData1["p_p_proinfo"] = "--";
+ $csvData1["p_proinfo"] = "--";
+ $csvData1["proinfo"] = "--";
+ $csvData1["pay_time"] = "--";
+ mb_convert_variables('GBK', 'UTF-8', $csvData1);
+ fputcsv($fp, $csvData1);
+ $xlsData[] = $csvData1;
fclose($fp);
$this->backSuccessExport($id);
}
From 174f90bff427bf6c9d92404288ceca9828b6e8af Mon Sep 17 00:00:00 2001
From: chenxiaojun <956334972@qq.com>
Date: Mon, 2 Dec 2019 14:15:45 +0800
Subject: [PATCH 5/7] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=AE=A1=E7=90=86-=E8=AE=A2=E5=8D=95?=
=?UTF-8?q?=E6=9F=A5=E8=AF=A2|=E6=95=B0=E6=8D=AE=E7=AE=A1=E7=90=86-?=
=?UTF-8?q?=E5=85=85=E5=80=BC=E7=BB=9F=E8=AE=A1|=E8=B4=A2=E5=8A=A1?=
=?UTF-8?q?=E7=AE=A1=E7=90=86-=E7=BB=93=E7=AE=97=E6=98=8E=E7=BB=86--?=
=?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=90=88=E8=AE=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Home/Controller/FinanceController.class.php | 5 ++++-
Application/Home/View/default/Finance/settlementDtl.html | 9 ++-------
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/Application/Home/Controller/FinanceController.class.php b/Application/Home/Controller/FinanceController.class.php
index b9d6d174f..c0c245b2e 100644
--- a/Application/Home/Controller/FinanceController.class.php
+++ b/Application/Home/Controller/FinanceController.class.php
@@ -223,9 +223,12 @@ class FinanceController extends BaseController
->page($page, $row)
->select();
$count = $model->where($map)->count();
- $total = $model->field('sum(pay_amount) as pay_amount,pay_way,sum(if(selle_ratio >= 0,selle_ratio * pay_amount,0)) as income')
+ $total = $model->field('sum(pay_amount) as pay_amount,sum(if(pay_way > -1,pay_amount,0)) as direct_pay_amount,sum(if(pay_way = -1,pay_amount,0)) as inner_pay_amount,sum(if(selle_ratio >= 0,selle_ratio * pay_amount,0)) as income')
->where($map)
->find();
+ $total['direct_pay_amount'] = empty($total['direct_pay_amount']) ? '0.00' : $total['direct_pay_amount'];
+ $total['inner_pay_amount'] = empty($total['inner_pay_amount']) ? '0.00' : $total['inner_pay_amount'];
+ $total['income'] = empty($total['income']) ? 0 : $total['income'];
$total['income'] = bcdiv($total['income'], 100, 2);
//提现状态
diff --git a/Application/Home/View/default/Finance/settlementDtl.html b/Application/Home/View/default/Finance/settlementDtl.html
index a62bdff29..bb44b46ef 100644
--- a/Application/Home/View/default/Finance/settlementDtl.html
+++ b/Application/Home/View/default/Finance/settlementDtl.html
@@ -182,13 +182,8 @@
-- |
-- |
{$total.pay_amount} |
-
- 0.00 |
- {$total.pay_amount} |
-
- {$total.pay_amount} |
- 0.00 |
-
+ {$total.direct_pay_amount} |
+ {$total.inner_pay_amount} |
-- |
{$total.income} |
-- |
From f596288f319012f929a0160ece349a9dcf8a9a58 Mon Sep 17 00:00:00 2001
From: chenxiaojun <956334972@qq.com>
Date: Mon, 2 Dec 2019 14:19:06 +0800
Subject: [PATCH 6/7] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=AE=A1=E7=90=86->=E8=B4=A2=E5=8A=A1?=
=?UTF-8?q?=E7=AE=A1=E7=90=86-=E7=BB=93=E7=AE=97=E6=98=8E=E7=BB=86--?=
=?UTF-8?q?=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Home/View/default/Finance/settlementDtl.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Application/Home/View/default/Finance/settlementDtl.html b/Application/Home/View/default/Finance/settlementDtl.html
index bb44b46ef..f8aecb696 100644
--- a/Application/Home/View/default/Finance/settlementDtl.html
+++ b/Application/Home/View/default/Finance/settlementDtl.html
@@ -164,11 +164,11 @@
{$vo.promote_account} |
{$vo.pay_amount} |
- 0 |
+ 0.00 |
{$vo.pay_amount} |
{$vo.pay_amount} |
- 0 |
+ 0.00 |
{$vo.selle_ratio}%|{$vo.selle_ratio}% |
{$vo.income} |
From b3ac26ba80e7c52a6d49bc498a47ec79c13eabdb Mon Sep 17 00:00:00 2001
From: sunke <18850253506@163.com>
Date: Mon, 2 Dec 2019 14:20:57 +0800
Subject: [PATCH 7/7] =?UTF-8?q?=E5=90=88=E8=AE=A1=E5=8C=BA=E5=88=86?=
=?UTF-8?q?=E7=B1=BB=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controller/DownloadController.class.php | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php
index 7988cdcd0..eb1a918fc 100644
--- a/Application/Home/Controller/DownloadController.class.php
+++ b/Application/Home/Controller/DownloadController.class.php
@@ -2503,9 +2503,12 @@ class DownloadController extends BaseController {
->order('id desc')
->select();
$total = [];
- $total = $model->field('sum(pay_amount) as pay_amount,pay_way,sum(if(selle_ratio >= 0,selle_ratio * pay_amount,0)) as income')
- ->where($map)
- ->find();
+ $total = $model->field('sum(pay_amount) as pay_amount,sum(if(pay_way > -1,pay_amount,0)) as direct_pay_amount,sum(if(pay_way = -1,pay_amount,0)) as inner_pay_amount,sum(if(selle_ratio >= 0,selle_ratio * pay_amount,0)) as income')
+ ->where($map)
+ ->find();
+ $total['direct_pay_amount'] = empty($total['direct_pay_amount']) ? '0.00' : $total['direct_pay_amount'];
+ $total['inner_pay_amount'] = empty($total['inner_pay_amount']) ? '0.00' : $total['inner_pay_amount'];
+ $total['income'] = empty($total['income']) ? 0 : $total['income'];
$total['income'] = bcdiv($total['income'], 100, 2);
//提现状态
$withdrawIds = [];
@@ -2558,13 +2561,8 @@ class DownloadController extends BaseController {
$allData['user_account'] = '--';
$allData['promote_account'] = '--';
$allData['pay_amount'] = $total['pay_amount'];
- if($total['pay_way'] == -1) {
- $allData['pay_amount_zhi'] = '0.00';
- $allData['pay_amount_nei'] = $total['pay_amount'];
- }else {
- $allData['pay_amount_zhi'] = $total['pay_amount'];
- $allData['pay_amount_nei'] = '0.00';
- }
+ $allData['pay_amount_zhi'] = $total['direct_pay_amount'];
+ $allData['pay_amount_nei'] = $total['inner_pay_amount'];
$allData['selle_ratio'] = '--';
$allData['selle_ratio'] = '--';
$allData['income'] = $total['income'];