From 2adcb68c06625eed6b8af090fe9bbff0080f098d Mon Sep 17 00:00:00 2001
From: sunke <18850253506@163.com>
Date: Fri, 10 Apr 2020 16:22:07 +0800
Subject: [PATCH 01/11] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=B8=81=E6=96=B0?=
=?UTF-8?q?=E5=A2=9E=E9=9C=80=E6=B1=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controller/FinanceController.class.php | 105 ++++++++++++++---
.../Admin/View/Finance/valueDetail.html | 108 +++++++++++++++++-
2 files changed, 190 insertions(+), 23 deletions(-)
diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php
index af36e5c70..2cc34b08d 100644
--- a/Application/Admin/Controller/FinanceController.class.php
+++ b/Application/Admin/Controller/FinanceController.class.php
@@ -1243,6 +1243,10 @@ class FinanceController extends ThinkController
$nowTime = date('Y-m-d');
$initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
$initEndTime = date('Y-m-d', time());
+ $sort = $_REQUEST['sort'];
+ if (empty($sort)) {
+ $sort = 13;
+ }
if(!empty($_REQUEST['user_account'])) {
$map['account'] = $_REQUEST['user_account'];
$map0['account'] = $_REQUEST['user_account'];
@@ -1266,11 +1270,70 @@ class FinanceController extends ThinkController
$map['create_time'] = array('between', [strtotime($initBegTime), strtotime($initEndTime) + 86399]);
}
- $datas = M('user', 'tab_')
- ->field('id, account')
- ->where($map0)
- ->page($page,$row)
- ->select();
+ $order = 'id desc';
+ if ($sort == 1) {
+ $order = 'spendvalue desc';
+ }
+ if ($sort == 2) {
+ $order = 'deposit desc';
+ }
+ if ($sort == 3 || $sort == 5) {
+ $order = 'spendvalue desc';
+ }
+
+ if ($sort == 4) {
+ $order = 'spendvalue asc';
+ }
+
+ if ($sort == 6) {
+ $order = 'deposit desc';
+ }
+ if ($sort == 7) {
+ $order = 'deposit asc';
+ }
+
+ if ($sort == 9) {
+ $order = 'promoteCoin desc';
+ }
+ if ($sort == 10) {
+ $order = 'promoteCoin asc';
+ }
+
+ if ($sort == 11) {
+ $order = 'id asc';
+ }
+ if ($sort == 12) {
+ $order = 'id desc';
+ }
+ $this->assign('sorting', $sort);
+ $map5['v.pay_type'] = 1;
+ $map5['v.create_time'] = $map['create_time'];
+ $map5[] = ['u.id = v.user_id'] ;
+
+ $map6[] = ['u.id = v.user_id'];
+ $map6['v.pay_type'] = 2;
+ $map6['v.create_time'] = $map['create_time'];
+
+ $map7[] = ['u.id = v.user_id'];
+ $map7['v.pay_type'] = 3;
+ $map7['v.create_time'] = $map['create_time'];
+
+ $valueQuery5 = M('value_detail_log', 'tab_')->alias('v')->field('sum(abs(v.value)) as spend_value')
+ ->where($map5)->buildSql();
+ $valueQuery6 = M('value_detail_log', 'tab_')->alias('v')->field('sum(v.value) as spend_value')
+ ->where($map6)->buildSql();
+ $valueQuery7 = M('value_detail_log', 'tab_')->alias('v')->field('sum(v.value) as spend_value')
+ ->where($map7)->buildSql();
+
+ $datas = M('user', 'tab_')->alias('u')->field("u.id, u.account, {$valueQuery5} as spendvalue, {$valueQuery6} as deposit, {$valueQuery7} as promoteCoin")->where($map0)->page($page,$row)->order($order)->group('u.id')->select();
+ // var_dump($datas);die();
+ // $datas = M('user', 'tab_')
+ // ->field('id, account')
+ // ->where($map0)
+ // ->page($page,$row)
+ // ->order('id desc')
+ // ->select();
+
$count = M('user', 'tab_')
->field('id, account')
->where($map)
@@ -1285,30 +1348,38 @@ class FinanceController extends ThinkController
$account = $data['account'];
$allDatas[$key]['user_id'] = $id;
$allDatas[$key]['user_account'] = $account;
- $map5['user_id'] = $id;
- $map5['pay_type'] = 1;
- $map5['create_time'] = $map['create_time'];
- $spend = M('value_detail_log', 'tab_')->where($map5)->sum('value');
+ // $map5['user_id'] = $id;
+ // $map5['pay_type'] = 1;
+ // $map5['create_time'] = $map['create_time'];
+ // $spend = M('value_detail_log', 'tab_')->where($map5)->sum('value');
+ $spend = $data['spendvalue'];
if(empty($spend)) {
$spend = '0.00';
}else {
$spend = number_format(abs($spend),2,'.','');
}
- $map6['user_id'] = $id;
- $map6['pay_type'] = 2;
- $map6['create_time'] = $map['create_time'];
- $deposit = M('value_detail_log', 'tab_')->where($map6)->sum('value');
+ // $map6['user_id'] = $id;
+ // $map6['pay_type'] = 2;
+ // $map6['create_time'] = $map['create_time'];
+ // $deposit = M('value_detail_log', 'tab_')->where($map6)->sum('value');
+ $deposit = $data['deposit'];
if(empty($deposit)) {
$deposit = '0.00';
}
- $map7['user_id'] = $id;
- $map7['pay_type'] = 3;
- $map7['create_time'] = $map['create_time'];
- $promoteCoin = M('value_detail_log', 'tab_')->where($map7)->sum('value');
+ // $map7['user_id'] = $id;
+ // $map7['pay_type'] = 3;
+ // $map7['create_time'] = $map['create_time'];
+ // $promoteCoin = M('value_detail_log', 'tab_')->where($map7)->sum('value');
+ $promoteCoin = $data['promoteCoin'];
if(empty($promoteCoin)) {
$promoteCoin = '0.00';
}
+ $restValue = $data['restValue'];
+ if(empty($restValue)) {
+ $restValue = '0.00';
+ }
// $allDatas[$key]['bind_balance'] = $bind_balance;
+ $allDatas[$key]['rest_value'] = $deposit - $spend ;
$allDatas[$key]['spend_amount'] = $spend;
$allDatas[$key]['deposit_amount'] = $deposit;
$allDatas[$key]['coin_amount'] = $promoteCoin;
diff --git a/Application/Admin/View/Finance/valueDetail.html b/Application/Admin/View/Finance/valueDetail.html
index 35d34c4cd..52cdbcf63 100644
--- a/Application/Admin/View/Finance/valueDetail.html
+++ b/Application/Admin/View/Finance/valueDetail.html
@@ -74,9 +74,11 @@
+
+
@@ -90,12 +92,47 @@
- 账号ID |
+
+ 账号ID |
+
+ 账号ID▼ |
+
+
+ 账号ID▲ |
+
+ 账号ID |
+
玩家账号 |
- 账户平台币 |
- 累计使用平台币 |
- 累计充值平台币 |
- 后台发放平台币 |
+ 平台币余额 |
+ 平台币直充余额 |
+
+ 平台币直充支出 |
+
+ 平台币直充支出▼ |
+
+ 平台币直充支出▲ |
+
+ 平台币直充支出 |
+
+
+
+ 平台币直充金额 |
+
+ 平台币直充金额▼ |
+
+ 平台币直充金额▲ |
+
+ 平台币直充金额 |
+
+
+ 后台发放平台币 |
+
+ 后台发放平台币▼ |
+
+ 后台发放平台币▲ |
+
+ 后台发放平台币 |
+
操作 |
@@ -110,6 +147,7 @@
{$data.user_id} |
{$data.user_account} |
{$data.after_value} |
+ {$data.rest_value} |
{$data.spend_amount} |
{$data.deposit_amount} |
{$data.coin_amount} |
@@ -377,4 +415,62 @@
});
});
+
From 253c956794656fceb3165f1268a538485922b400 Mon Sep 17 00:00:00 2001
From: sunke <18850253506@163.com>
Date: Mon, 13 Apr 2020 09:15:12 +0800
Subject: [PATCH 02/11] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=B8=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controller/ExportController.class.php | 89 ++++++++++++-------
.../Controller/FinanceController.class.php | 85 ++++++++++--------
.../Admin/View/Finance/valueDetail.html | 39 ++++++--
3 files changed, 135 insertions(+), 78 deletions(-)
diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php
index 2d48c4a3c..de98b3833 100644
--- a/Application/Admin/Controller/ExportController.class.php
+++ b/Application/Admin/Controller/ExportController.class.php
@@ -2475,7 +2475,7 @@ class ExportController extends Controller
break;
case 28:
$xlsCell = array(
- "账号ID","玩家账号", "账户平台币", "累计使用平台币", "累计充值平台币", "后台发放平台币"
+ "账号ID","玩家账号", "平台币余额", "平台币直充余额", "平台币直充支出", "平台币直充金额", "后台发放平台币"
);
$params = I('get.');
@@ -2545,54 +2545,82 @@ class ExportController extends Controller
->field('id, account')
->where($map)
->count();
-
+
$perSize = 1000;//每次查询的条数
$pages = ceil($count / $perSize);
for($i = 1; $i <= $pages; $i++) {
- $datas = M('user', 'tab_')
- ->field('id, account')
- ->where($map)
- ->limit(($i-1)*$perSize ,$perSize)
- ->select();
+ // $datas = M('user', 'tab_')
+ // ->field('id, account')
+ // ->where($map)
+ // ->limit(($i-1)*$perSize ,$perSize)
+ // ->select();
+ $map5['v.pay_type'] = 1;
+ $map5['v.create_time'] = $map['create_time'];
+ $map5[] = ['u.id = v.user_id'] ;
+
+ $map6[] = ['u.id = v.user_id'];
+ $map6['v.pay_type'] = 2;
+ $map6['v.create_time'] = $map['create_time'];
+
+ $map7[] = ['u.id = v.user_id'];
+ $map7['v.pay_type'] = 3;
+ $map7['v.create_time'] = $map['create_time'];
+
+ $map8[] = ['u.id = v.user_id'];
+ $map8['v.create_time'] = $map['create_time'];
+
+ $valueQuery5 = M('value_detail_log', 'tab_')->alias('v')->field('sum(abs(v.value)) as spend_value')
+ ->where($map5)->buildSql();
+ $valueQuery6 = M('value_detail_log', 'tab_')->alias('v')->field('sum(v.value) as spend_value')
+ ->where($map6)->buildSql();
+ $valueQuery7 = M('value_detail_log', 'tab_')->alias('v')->field('sum(v.value) as spend_value')
+ ->where($map7)->buildSql();
+ $valueQuery8 = M('value_detail_log', 'tab_')->alias('v')->field('after_value')->where($map8)->order('create_time desc')->limit(1)->buildSql();
+ $datas = M('user', 'tab_')->alias('u')->field("u.id, u.account, {$valueQuery8} as totalvalue, {$valueQuery5} as spendvalue, {$valueQuery6} as deposit, {$valueQuery7} as promoteCoin , if (({$valueQuery6}) - ({$valueQuery5}) > 0, ({$valueQuery6}) - ({$valueQuery5}), 0) as restvalue")->where($map)->limit(($i-1)*$perSize ,$perSize)->order('restvalue desc')->group('u.id')->select();
+ $query = M('user', 'tab_')->alias('u')->field("u.id, u.account, {$valueQuery8} as totalvalue, {$valueQuery5} as spendvalue, {$valueQuery6} as deposit, {$valueQuery7} as promoteCoin , if (({$valueQuery6}) - ({$valueQuery5}) > 0, ({$valueQuery6}) - ({$valueQuery5}), 0) as restvalue")->where($map)->order('id desc')->group('u.id')->buildSql();
+ $allTotalValue1 = M()->alias('t')->table($query)->sum('t.totalvalue');
+ $allRestValue = M()->alias('rest')->table($query)->sum('rest.restvalue');
$allDatas = [];
foreach($datas as $key => $data) {
$allDatas['user_id'] = $data['id'];
$allDatas['user_account'] = $data['account'];
$spend = M('value_detail_log', 'tab_')->where(['user_id'=>$data['id'], 'pay_type'=>1])->sum('value');
- $map5['user_id'] = $data['id'];
- $map5['pay_type'] = 1;
- $map5['create_time'] = $map['create_time'];
- $spend = M('value_detail_log', 'tab_')->where($map5)->sum('value');
-
+ // $map5['user_id'] = $data['id'];
+ // $map5['pay_type'] = 1;
+ // $map5['create_time'] = $map['create_time'];
+ // $spend = M('value_detail_log', 'tab_')->where($map5)->sum('value');
+ $spend = $data['spendvalue'];
if(empty($spend)) {
$spend = '0.00';
}else {
$spend = number_format(abs($spend),2,'.','');
}
- $map6['user_id'] = $data['id'];
- $map6['pay_type'] = 2;
- $map6['create_time'] = $map['create_time'];
- $deposit = M('value_detail_log', 'tab_')->where($map6)->sum('value');
+ // $map6['user_id'] = $data['id'];
+ // $map6['pay_type'] = 2;
+ // $map6['create_time'] = $map['create_time'];
+ // $deposit = M('value_detail_log', 'tab_')->where($map6)->sum('value');
+ $deposit = $data['deposit'];
if(empty($deposit)) {
$deposit = '0.00';
}
- $map7['user_id'] = $id;
- $map7['pay_type'] = 3;
- $map7['create_time'] = $map['create_time'];
- $promoteCoin = M('value_detail_log', 'tab_')->where($map7)->sum('value');
+ // $map7['user_id'] = $id;
+ // $map7['pay_type'] = 3;
+ // $map7['create_time'] = $map['create_time'];
+ // $promoteCoin = M('value_detail_log', 'tab_')->where($map7)->sum('value');
+ $promoteCoin = $data['promoteCoin'];
if(empty($promoteCoin)) {
$promoteCoin = '0.00';
}
-
- $map8['user_id'] = $data['id'];
- $map8['create_time'] = $map['create_time'];
- $newValueByTimeDatas = M('value_detail_log', 'tab_')->field('after_value')->where($map8)->order('create_time desc')->limit(1)->select();
- if(empty($newValueByTimeDatas)) {
- $aValue = '0.00';
- }else {
- $aValue = $newValueByTimeDatas[0]['after_value'];
+ $restValue = $data['restvalue'];
+ if(empty($restValue)) {
+ $restValue = '0.00';
+ }
+ $alltotalvalue = $data['totalvalue'];
+ if(empty($alltotalvalue)) {
+ $alltotalvalue = '0.00';
}
- $allDatas['bind_balance'] = $aValue;
+ $allDatas['bind_balance'] = $alltotalvalue;
+ $allDatas['rest_value'] = $restValue ;
$allDatas['spend_amount'] = $spend;
$allDatas['deposit_amount'] = $deposit;
$allDatas['coin_amount'] = $promoteCoin;
@@ -2608,7 +2636,8 @@ class ExportController extends Controller
}
$alldatas1['user_id'] = "汇总(检索时间内所有数据的统计)";
$alldatas1['user_account'] = "";
- $alldatas1['bind_balance'] = $banlaceTotal;
+ $alldatas1['bind_balance'] = $allTotalValue1;
+ $alldatas1['restvalue'] = $allRestValue;
$alldatas1['spend_amount'] = abs($totalSpend);
$alldatas1['deposit_amount'] = $deposit1;
$alldatas1['coin_amount'] = $promoteCoin;
diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php
index 2cc34b08d..8bf6417c7 100644
--- a/Application/Admin/Controller/FinanceController.class.php
+++ b/Application/Admin/Controller/FinanceController.class.php
@@ -1305,6 +1305,13 @@ class FinanceController extends ThinkController
if ($sort == 12) {
$order = 'id desc';
}
+
+ if ($sort == 16) {
+ $order = 'restvalue desc';
+ }
+ if ($sort == 17) {
+ $order = 'restvalue asc';
+ }
$this->assign('sorting', $sort);
$map5['v.pay_type'] = 1;
$map5['v.create_time'] = $map['create_time'];
@@ -1318,14 +1325,21 @@ class FinanceController extends ThinkController
$map7['v.pay_type'] = 3;
$map7['v.create_time'] = $map['create_time'];
+ $map8[] = ['u.id = v.user_id'];
+ $map8['v.create_time'] = $map['create_time'];
+
$valueQuery5 = M('value_detail_log', 'tab_')->alias('v')->field('sum(abs(v.value)) as spend_value')
->where($map5)->buildSql();
$valueQuery6 = M('value_detail_log', 'tab_')->alias('v')->field('sum(v.value) as spend_value')
->where($map6)->buildSql();
$valueQuery7 = M('value_detail_log', 'tab_')->alias('v')->field('sum(v.value) as spend_value')
->where($map7)->buildSql();
-
- $datas = M('user', 'tab_')->alias('u')->field("u.id, u.account, {$valueQuery5} as spendvalue, {$valueQuery6} as deposit, {$valueQuery7} as promoteCoin")->where($map0)->page($page,$row)->order($order)->group('u.id')->select();
+ $valueQuery8 = M('value_detail_log', 'tab_')->alias('v')->field('after_value')->where($map8)->order('create_time desc')->limit(1)->buildSql();
+ $datas = M('user', 'tab_')->alias('u')->field("u.id, u.account, {$valueQuery8} as totalvalue, {$valueQuery5} as spendvalue, {$valueQuery6} as deposit, {$valueQuery7} as promoteCoin , if (({$valueQuery6}) - ({$valueQuery5}) > 0, ({$valueQuery6}) - ({$valueQuery5}), 0) as restvalue")->where($map0)->page($page,$row)->order($order)->group('u.id')->select();
+ $query = M('user', 'tab_')->alias('u')->field("u.id, u.account, {$valueQuery8} as totalvalue, {$valueQuery5} as spendvalue, {$valueQuery6} as deposit, {$valueQuery7} as promoteCoin , if (({$valueQuery6}) - ({$valueQuery5}) > 0, ({$valueQuery6}) - ({$valueQuery5}), 0) as restvalue")->where($map0)->order($order)->group('u.id')->buildSql();
+ $allTotalValue1 = M()->alias('t')->table($query)->sum('t.totalvalue');
+ $allRestValue = M()->alias('rest')->table($query)->sum('rest.restvalue');
+
// var_dump($datas);die();
// $datas = M('user', 'tab_')
// ->field('id, account')
@@ -1333,7 +1347,7 @@ class FinanceController extends ThinkController
// ->page($page,$row)
// ->order('id desc')
// ->select();
-
+
$count = M('user', 'tab_')
->field('id, account')
->where($map)
@@ -1348,38 +1362,31 @@ class FinanceController extends ThinkController
$account = $data['account'];
$allDatas[$key]['user_id'] = $id;
$allDatas[$key]['user_account'] = $account;
- // $map5['user_id'] = $id;
- // $map5['pay_type'] = 1;
- // $map5['create_time'] = $map['create_time'];
- // $spend = M('value_detail_log', 'tab_')->where($map5)->sum('value');
- $spend = $data['spendvalue'];
+ $spend = $data['spendvalue'];
if(empty($spend)) {
$spend = '0.00';
}else {
$spend = number_format(abs($spend),2,'.','');
}
- // $map6['user_id'] = $id;
- // $map6['pay_type'] = 2;
- // $map6['create_time'] = $map['create_time'];
- // $deposit = M('value_detail_log', 'tab_')->where($map6)->sum('value');
$deposit = $data['deposit'];
if(empty($deposit)) {
$deposit = '0.00';
}
- // $map7['user_id'] = $id;
- // $map7['pay_type'] = 3;
- // $map7['create_time'] = $map['create_time'];
- // $promoteCoin = M('value_detail_log', 'tab_')->where($map7)->sum('value');
$promoteCoin = $data['promoteCoin'];
if(empty($promoteCoin)) {
$promoteCoin = '0.00';
}
- $restValue = $data['restValue'];
+ $restValue = $data['restvalue'];
if(empty($restValue)) {
$restValue = '0.00';
}
+ $alltotalvalue = $data['totalvalue'];
+ if(empty($alltotalvalue)) {
+ $alltotalvalue = '0.00';
+ }
// $allDatas[$key]['bind_balance'] = $bind_balance;
- $allDatas[$key]['rest_value'] = $deposit - $spend ;
+ $allDatas[$key]['after_value'] = $alltotalvalue ;
+ $allDatas[$key]['rest_value'] = $restValue ;
$allDatas[$key]['spend_amount'] = $spend;
$allDatas[$key]['deposit_amount'] = $deposit;
$allDatas[$key]['coin_amount'] = $promoteCoin;
@@ -1406,28 +1413,28 @@ class FinanceController extends ThinkController
}else {
$banlace = M('value_detail_log', 'tab_')->field('user_id, after_value')->where($map4)->order('create_time desc')->select();
}
- $banlaceTotal = '0.00';
- foreach($banlace as $k222 => $vvv) {
- $banlaceTotal += $vvv['after_value'];
- }
- $banlaceTotal = number_format($banlaceTotal,2,'.','');
+ // $banlaceTotal = '0.00';
+ // foreach($banlace as $k222 => $vvv) {
+ // $banlaceTotal += $vvv['after_value'];
+ // }
+ // $banlaceTotal = number_format($banlaceTotal,2,'.','');
$map['user_id'] = ['in', $ids];
- $newValueByTimeDatas = M('value_detail_log', 'tab_')->field('user_id, after_value, create_time')->where($map)->order('create_time desc')->limit(1)->select();
+ // $newValueByTimeDatas = M('value_detail_log', 'tab_')->field('user_id, after_value, create_time')->where($map)->order('create_time desc')->limit(1)->select();
+ // var_dump($newValueByTimeDatas);
+ // // var_dump($newValueByTimeDatas);die();
+ // foreach ($allDatas as $k => $allData) {
+ // $allDatas[$k]['after_value'] = "0.00";
+ // foreach ($newValueByTimeDatas as $key1 => $newValueByTimeData ) {
+ // if (intval($allData['user_id']) == intval($newValueByTimeData['user_id'])) {
+ // $allDatas[$k]['after_value'] = $newValueByTimeData['after_value'];
+ // break;
+ // }else {
+ // $allDatas[$k]['after_value'] = "0.00";
- // var_dump($newValueByTimeDatas);die();
- foreach ($allDatas as $k => $allData) {
- $allDatas[$k]['after_value'] = "0.00";
- foreach ($newValueByTimeDatas as $key1 => $newValueByTimeData ) {
- if (intval($allData['user_id']) == intval($newValueByTimeData['user_id'])) {
- $allDatas[$k]['after_value'] = $newValueByTimeData['after_value'];
- break;
- }else {
- $allDatas[$k]['after_value'] = "0.00";
-
- }
- }
+ // }
+ // }
- }
+ // }
$page = set_pagination($count,$row);
if($page) {$this->assign('_page', $page);}
if(empty($_REQUEST['timestart']) && empty($_REQUEST['timeend']) && empty(I('user_account'))) {
@@ -1437,12 +1444,12 @@ class FinanceController extends ThinkController
$this->assign('starttime', $_REQUEST['timestart']);
$this->assign('endtime', $_REQUEST['timeend']);
}
- $this->assign('banlaceTotal', $banlaceTotal);
+ $this->assign('banlaceTotal', $allTotalValue1);
$this->assign('total', $totalSpend);
$this->assign('deposit', $deposit);
$this->assign('promoteCoin', $allpromoteCoin);
$this->assign('data', $allDatas);
-
+ $this->assign('resttotal', $allRestValue);
$this->display();
}
diff --git a/Application/Admin/View/Finance/valueDetail.html b/Application/Admin/View/Finance/valueDetail.html
index 52cdbcf63..5676265e4 100644
--- a/Application/Admin/View/Finance/valueDetail.html
+++ b/Application/Admin/View/Finance/valueDetail.html
@@ -93,45 +93,53 @@
- 账号ID |
+ 账号ID▭ |
账号ID▼ |
账号ID▲ |
- 账号ID |
+ 账号ID▭ |
玩家账号 |
平台币余额 |
- 平台币直充余额 |
- 平台币直充支出 |
+ 平台币直充余额▭ |
+
+ 平台币直充余额▼ |
+
+ 平台币直充余额▲ |
+
+ 平台币直充余额▭ |
+
+
+ 平台币直充支出▭ |
平台币直充支出▼ |
平台币直充支出▲ |
- 平台币直充支出 |
+ 平台币直充支出▭ |
- 平台币直充金额 |
+ 平台币直充金额▭ |
平台币直充金额▼ |
平台币直充金额▲ |
- 平台币直充金额 |
+ 平台币直充金额▭ |
- 后台发放平台币 |
+ 后台发放平台币▭ |
后台发放平台币▼ |
后台发放平台币▲ |
- 后台发放平台币 |
+ 后台发放平台币▭ |
操作 |
@@ -161,6 +169,7 @@
汇总(检索时间内所有数据的统计) |
{$banlaceTotal} |
+ {$resttotal} |
{$total} |
{$deposit} |
{$promoteCoin} |
@@ -468,6 +477,18 @@
document.getElementById('sort').value = 9
document.getElementById('search').click();
}
+ if (status == 16) {
+ document.getElementById('sort').value = 16
+ document.getElementById('search').click();
+ }
+ if (status == 17) {
+ document.getElementById('sort').value = 17
+ document.getElementById('search').click();
+ }
+ if (status == 18) {
+ document.getElementById('sort').value = 16
+ document.getElementById('search').click();
+ }
From c1168740b623f83f45d8fb9ffc3122df60f311a1 Mon Sep 17 00:00:00 2001
From: sunke <18850253506@163.com>
Date: Mon, 13 Apr 2020 09:25:03 +0800
Subject: [PATCH 03/11] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=B8=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Admin/View/Finance/valueDetail.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Application/Admin/View/Finance/valueDetail.html b/Application/Admin/View/Finance/valueDetail.html
index 5676265e4..1a3a75aca 100644
--- a/Application/Admin/View/Finance/valueDetail.html
+++ b/Application/Admin/View/Finance/valueDetail.html
@@ -78,7 +78,7 @@
From 031528411b671ee8d4630d6d036e240cd1111c39 Mon Sep 17 00:00:00 2001
From: sunke <18850253506@163.com>
Date: Mon, 13 Apr 2020 11:40:38 +0800
Subject: [PATCH 04/11] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=B8=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Admin/View/Finance/valueDetail.html | 43 ++++++++++---------
1 file changed, 23 insertions(+), 20 deletions(-)
diff --git a/Application/Admin/View/Finance/valueDetail.html b/Application/Admin/View/Finance/valueDetail.html
index 1a3a75aca..9fbe60267 100644
--- a/Application/Admin/View/Finance/valueDetail.html
+++ b/Application/Admin/View/Finance/valueDetail.html
@@ -25,6 +25,9 @@
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
+ .pointer-hand {
+ cursor: pointer;
+ }
@@ -93,53 +96,53 @@
- 账号ID▭ |
+ 账号ID▭ |
- 账号ID▼ |
+ 账号ID▼ |
- 账号ID▲ |
+ 账号ID▲ |
- 账号ID▭ |
+ 账号ID▭ |
玩家账号 |
平台币余额 |
- 平台币直充余额▭ |
+ 平台币直充余额▭ |
- 平台币直充余额▼ |
+ 平台币直充余额▼ |
- 平台币直充余额▲ |
+ 平台币直充余额▲ |
- 平台币直充余额▭ |
+ 平台币直充余额▭ |
- 平台币直充支出▭ |
+ 平台币直充支出▭ |
- 平台币直充支出▼ |
+ 平台币直充支出▼ |
- 平台币直充支出▲ |
+ 平台币直充支出▲ |
- 平台币直充支出▭ |
+ 平台币直充支出▭ |
- 平台币直充金额▭ |
+ 平台币直充金额▭ |
- 平台币直充金额▼ |
+ 平台币直充金额▼ |
- 平台币直充金额▲ |
+ 平台币直充金额▲ |
- 平台币直充金额▭ |
+ 平台币直充金额▭ |
- 后台发放平台币▭ |
+ 后台发放平台币▭ |
- 后台发放平台币▼ |
+ 后台发放平台币▼ |
- 后台发放平台币▲ |
+ 后台发放平台币▲ |
- 后台发放平台币▭ |
+ 后台发放平台币▭ |
操作 |
From b6649a7b9deb5911e1168b215bc35c6b990253dc Mon Sep 17 00:00:00 2001
From: sunke <18850253506@163.com>
Date: Mon, 13 Apr 2020 19:03:50 +0800
Subject: [PATCH 05/11] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=B8=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controller/FinanceController.class.php | 13 ++++++++---
.../Admin/View/Finance/valueDetail.html | 23 ++++++++++++++++++-
2 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php
index 8bf6417c7..f61e32448 100644
--- a/Application/Admin/Controller/FinanceController.class.php
+++ b/Application/Admin/Controller/FinanceController.class.php
@@ -1312,6 +1312,13 @@ class FinanceController extends ThinkController
if ($sort == 17) {
$order = 'restvalue asc';
}
+
+ if ($sort == 19) {
+ $order = 'totalvalue desc';
+ }
+ if ($sort == 20) {
+ $order = 'totalvalue asc';
+ }
$this->assign('sorting', $sort);
$map5['v.pay_type'] = 1;
$map5['v.create_time'] = $map['create_time'];
@@ -1357,6 +1364,7 @@ class FinanceController extends ThinkController
$ids = [-100];
}
$allDatas = [];
+
foreach($datas as $key => $data) {
$id = $data['id'];
$account = $data['account'];
@@ -1372,7 +1380,7 @@ class FinanceController extends ThinkController
if(empty($deposit)) {
$deposit = '0.00';
}
- $promoteCoin = $data['promoteCoin'];
+ $promoteCoin = $data['promotecoin'];
if(empty($promoteCoin)) {
$promoteCoin = '0.00';
}
@@ -1405,8 +1413,7 @@ class FinanceController extends ThinkController
$map3['create_time'] = $map['create_time'];
$map3['pay_type'] = 3;
$allpromoteCoin = M('value_detail_log', 'tab_')->where($map3)->sum('value');
- $allpromoteCoin = empty($promoteCoin) ? '0.00' : number_format($allpromoteCoin,2,'.','');
-
+ $allpromoteCoin = empty($allpromoteCoin) ? '0.00' : number_format($allpromoteCoin,2,'.','');
$map4['create_time'] = $map['create_time'];
if($_REQUEST['user_account']) {
$banlace = M('value_detail_log', 'tab_')->field('user_id, after_value')->where($map4)->order('create_time desc')->limit(1)->select();
diff --git a/Application/Admin/View/Finance/valueDetail.html b/Application/Admin/View/Finance/valueDetail.html
index 9fbe60267..736108e3c 100644
--- a/Application/Admin/View/Finance/valueDetail.html
+++ b/Application/Admin/View/Finance/valueDetail.html
@@ -106,7 +106,15 @@
账号ID▭ |
玩家账号 |
- 平台币余额 |
+
+ 平台币余额▭ |
+
+ 平台币余额▼ |
+
+ 平台币余额▲ |
+
+ 平台币余额▭ |
+
平台币直充余额▭ |
@@ -492,6 +500,19 @@
document.getElementById('sort').value = 16
document.getElementById('search').click();
}
+
+ if (status == 19) {
+ document.getElementById('sort').value = 19
+ document.getElementById('search').click();
+ }
+ if (status == 20) {
+ document.getElementById('sort').value = 20
+ document.getElementById('search').click();
+ }
+ if (status == 21) {
+ document.getElementById('sort').value = 19
+ document.getElementById('search').click();
+ }
From 848eb6c294a974fa6c7940e06b8266d736233c37 Mon Sep 17 00:00:00 2001
From: sunke <18850253506@163.com>
Date: Mon, 13 Apr 2020 20:42:14 +0800
Subject: [PATCH 06/11] =?UTF-8?q?=E5=B9=B3=E5=8F=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Admin/View/Finance/valueDetail.html | 24 +++++++++---------
Public/Admin/images/paixu.png | Bin 0 -> 2958 bytes
2 files changed, 12 insertions(+), 12 deletions(-)
create mode 100644 Public/Admin/images/paixu.png
diff --git a/Application/Admin/View/Finance/valueDetail.html b/Application/Admin/View/Finance/valueDetail.html
index 736108e3c..60202cfdd 100644
--- a/Application/Admin/View/Finance/valueDetail.html
+++ b/Application/Admin/View/Finance/valueDetail.html
@@ -96,61 +96,61 @@
- 账号ID▭ |
+ 账号ID |
账号ID▼ |
账号ID▲ |
- 账号ID▭ |
+ 账号ID |
玩家账号 |
- 平台币余额▭ |
+ 平台币余额 |
平台币余额▼ |
平台币余额▲ |
- 平台币余额▭ |
+ 平台币余额 |
- 平台币直充余额▭ |
+ 平台币直充余额 |
平台币直充余额▼ |
平台币直充余额▲ |
- 平台币直充余额▭ |
+ 平台币直充余额 |
- 平台币直充支出▭ |
+ 平台币直充支出 |
平台币直充支出▼ |
平台币直充支出▲ |
- 平台币直充支出▭ |
+ 平台币直充支出 |
- 平台币直充金额▭ |
+ 平台币直充金额 |
平台币直充金额▼ |
平台币直充金额▲ |
- 平台币直充金额▭ |
+ 平台币直充金额 |
- 后台发放平台币▭ |
+ 后台发放平台币 |
后台发放平台币▼ |
后台发放平台币▲ |
- 后台发放平台币▭ |
+ 后台发放平台币 |
操作 |
diff --git a/Public/Admin/images/paixu.png b/Public/Admin/images/paixu.png
new file mode 100644
index 0000000000000000000000000000000000000000..ebb67b8d6c62ab4df6cd49177273e0770a7cec48
GIT binary patch
literal 2958
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
literal 0
HcmV?d00001
From aa14aa95a66ec1e5033e115007f3a751e73dc033 Mon Sep 17 00:00:00 2001
From: sunke <18850253506@163.com>
Date: Mon, 13 Apr 2020 20:48:20 +0800
Subject: [PATCH 07/11] =?UTF-8?q?=E5=B9=B3=E5=8F=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controller/ExportController.class.php | 143 +++++++++++++++---
1 file changed, 126 insertions(+), 17 deletions(-)
diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php
index de98b3833..014419e59 100644
--- a/Application/Admin/Controller/ExportController.class.php
+++ b/Application/Admin/Controller/ExportController.class.php
@@ -2265,7 +2265,7 @@ class ExportController extends Controller
$re_data['pay_time'] = set_show_time($order_detail['pay_time']);
$re_data['payed_time'] = set_show_time($order_detail['payed_time']);
} elseif($v['tab'] == 'deposit') {
- $order_detail = M('deposit', 'tab_')->field('create_time,payed_time,user_account,promote_account,pay_amount,pay_way')->where(['pay_order_number' => $v['pay_order_number']])->find();
+ $order_detail = M('deposit', 'tab_')->field('create_time,payed_time,user_account,promote_account,pay_amount,pay_way')->where(['pay_order_number' => $v['pay_order_number']])->find();
$re_data['pay_time'] = set_show_time($order_detail['create_time']);
$re_data['payed_time'] = set_show_time($order_detail['payed_time']);
}
@@ -2708,7 +2708,6 @@ class ExportController extends Controller
->where($map)
->limit(($i-1)*$perSize ,$perSize)
->select();
-
foreach ($valueDetailDatas as $key => $valueDetailData) {
$vlaueDetailData['order_number'] = $valueDetailData['order_number'];
$vlaueDetailData['create_time'] = date('Y-m-d H:i:s', $valueDetailData['create_time']);
@@ -2726,14 +2725,22 @@ class ExportController extends Controller
}
$vlaueDetailData['value'] = $valueDetailData['value'];
$vlaueDetailData['after_value'] = $valueDetailData['after_value'];
+ $map8['user_id'] = $id;
+ $map8['create_time'] = $map['create_time'];
+ $newValueByTimeDatas = M('value_detail_log', 'tab_')->field('after_value')->where($map8)->group('user_id')->select();
+ $aValue = $newValueByTimeDatas['after_value'];
+ $allDatas['bind_balance'] = $aValue;
+ $allDatas['spend_amount'] = $spend;
+ $allDatas['deposit_amount'] = $deposit;
+ $allDatas['coin_amount'] = $promoteCoin;
mb_convert_variables('GBK', 'UTF-8', $vlaueDetailData);
fputcsv($fp, $vlaueDetailData);
}
- unset($vlaueDetailDatas);//释放变量的内存
- //刷新输出缓冲到浏览器
- ob_flush();
- flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。
+
+
+ // mb_convert_variables('GBK', 'UTF-8', $allDatas);
+ // fputcsv($fp, $allDatas);
}
if($t >= 0 ) {
$fuhao = '+';
@@ -9012,6 +9019,7 @@ class ExportController extends Controller
array('status','状态'),
array('user_account','游戏账号'),
array('creator','创单人'),
+ array('handler','接单人'),
array('created_time', '创单时间'),
array('score', '分数'),
array('attachment_type', '附件')
@@ -9023,6 +9031,7 @@ class ExportController extends Controller
$item['type'] = $item['type'] == 1 ? '资源' : '反馈';
$item['status'] = $item['status'] == 1 ? '完成' : '处理中';
$item['creator'] = get_admin_name($item['creator_id']);
+ $item['handler'] = get_admin_name($item['handler_id']);
$item['created_time'] = date('Y-m-d H:i:s', $item['created_time']);
$item['attachment_type'] = empty($item['attachment_url']) ? '无' : '有';
$item['order_no'] = "\t{$item['order_no']}";
@@ -9064,13 +9073,17 @@ class ExportController extends Controller
$pdlMap .= " and pdl.create_time < {$endTime}";
}
- if ($info['level'] == PromoteModel::LEVEL_GROUP_LEADER) {
+ if ($level == PromoteModel::LEVEL_TEAM_MEMBER) {
+ $beginThisweek = mktime(0, 0 , 0,date("m"),date("d")-date("w")+1,date("Y"));
+ $endThisweek = mktime(23,59,59,date("m"),date("d")-date("w")+7,date("Y"));
$xlsData = M('promote', 'tab_')->alias('p')
- ->field('p.id, p.level, p.account, count(pdl.id) as lowerCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
+ ->field('p.id, p.level, p.account, count(u.id) as iosCount, count(if (u.register_time between '. $beginThisweek . ' and ' . $endThisweek .', 1, null)) as weekCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->join("tab_package_download_log pdl on pdl.promote_id = p.id $pdlMap", 'left')
+ ->join("tab_user u on u.promote_id = p.id and u.device_type=2", 'left')
->where($map)
->group('p.id')
- ->select();
+ ->select();
+
} else {
$xlsData = M('promote', 'tab_')->alias('p')
->field('p.id, p.level, p.account, count(if(p2.level = '.($level+1).', 1, null)) as lowerCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
@@ -9080,14 +9093,28 @@ class ExportController extends Controller
->group('p.id')
->select();
}
- $xlsCell = array(
- array('account', PromoteModel::$levelArr[$level]."账号"),
- array('lowercount', PromoteModel::$levelArr[$level+1]."数量"),
- array('tfcount', 'TF下载数'),
- array('supersigncount', "超级签下载数"),
- array('signcount', "企业签下载数"),
- );
-
+
+ if ($level == PromoteModel::LEVEL_TEAM_MEMBER) {
+ foreach($xlsData as &$item) {
+ $item['tfcount'] = $item['tfcount'] . "(" . (empty($item['ioscount']) ? 0 : round( ($item['tfcount'] / $item['ioscount']) * 100 , 2)) . ")%";
+ }
+ $xlsCell = array(
+ array('account', PromoteModel::$levelArr[$level]."账号"),
+ array('ioscount', "iOS用户总数"),
+ array('weekcount', "新增iOS用户总数"),
+ array('tfcount', 'TF下载数/iOS用户总数'),
+ array('supersigncount', "超级签下载数"),
+ array('signcount', "企业签下载数"),
+ );
+ } else {
+ $xlsCell = array(
+ array('account', PromoteModel::$levelArr[$level]."账号"),
+ array('lowercount', PromoteModel::$levelArr[$level+1]."数量"),
+ array('tfcount', 'TF下载数'),
+ array('supersigncount', "超级签下载数"),
+ array('signcount', "企业签下载数"),
+ );
+ }
$this->exportAddOperationLog('Statistics/packDownload','统计-IOS下载统计-导出');
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
@@ -9186,4 +9213,86 @@ class ExportController extends Controller
$this->exportExcel($xlsName, $xlsCell, $list);
}
+ public function exportWorkOrderStatistics()
+ {
+ $order = '';
+ if ($_REQUEST['data_order'] != '') {
+ $data_order = reset(explode(',', $_REQUEST['data_order']));
+ $data_order_type = end(explode(',', $_REQUEST['data_order']));
+ $this->assign('userarpu_order', $data_order);
+ $this->assign('userarpu_order_type', $data_order_type);
+ $order = 'order by ' . $data_order_type . " " . ($data_order == 3 ? 'desc' : 'asc');
+ }
+ $map = '1=1';
+ if (!empty(I('nickname'))) {
+ $map .= " and t.nickname = '" . I('nickname') . "'";
+ }
+ // 获取所有传单或者接单用户id
+ $userids = M('work_order_info', 'tab_')
+ ->field("concat(creator_id, ',', handler_id) as userid")
+ ->join('sys_member as t on creator_id = t.uid or handler_id = t.uid')
+ ->where($map)
+ ->select();
+ if (empty($userids)) {
+ $list = [];
+ $count = 0;
+ } else {
+ $userids = implode(',', array_unique(array_filter(explode(',', implode(',', array_column($userids, 'userid'))))));
+ $count = count($userids);
+ $list = M('work_order_info', 'tab_')->query("SELECT
+ t.id,
+ t.nickname,
+ sum(total_create_count) as total_create_count,
+ sum(total_accepted_count) as total_accepted_count,
+ sum(total_handle_count) as total_handle_count,
+ sum(total_complete_count) as total_complete_count
+ FROM
+ (
+ SELECT
+ u.uid as id,
+ u.nickname,
+ count(*) AS total_create_count,
+ count(
+
+ IF (i.`handler_id` > 0, 1, NULL)
+ ) AS total_accepted_count,
+ NULL AS total_handle_count,
+ NULL AS total_complete_count
+ FROM
+ sys_member u
+ LEFT JOIN tab_work_order_info i ON i.creator_id = u.uid
+ WHERE
+ u.uid in ({$userids})
+ GROUP BY u.uid
+ UNION
+ SELECT
+ u.uid as id,
+ u.nickname,
+ NULL AS total_create_count,
+ NULL AS total_accepted_count,
+ count(*) AS total_handle_count,
+ count(IF(i.`status` = 1, 1, NULL)) AS total_complete_count
+ FROM
+ sys_member u
+ JOIN tab_work_order_info i ON i.handler_id = u.uid
+ WHERE
+ u.uid in ({$userids})
+ GROUP BY u.uid
+ ) AS t
+ where {$map}
+ GROUP BY t.id
+ $order");
+ }
+ $xlsName = '工单统计报表';
+ $xlsCell = array(
+ array('nickname', "账号"),
+ array('total_create_count', "发布工单数"),
+ array('total_accepted_count', '被接手工单数'),
+ array('total_handle_count', "接手工单数"),
+ array('total_complete_count', "完成工单数"),
+ );
+
+ $this->exportAddOperationLog('Statistics/exportWorkOrderStatistics','用户-工单统计-导出');
+ $this->exportExcel($xlsName, $xlsCell, $list);
+ }
}
From 0758921bfed3906f2ec03aed0c7dff80923ae441 Mon Sep 17 00:00:00 2001
From: sunke <18850253506@163.com>
Date: Mon, 13 Apr 2020 20:53:39 +0800
Subject: [PATCH 08/11] =?UTF-8?q?=E5=B9=B3=E5=8F=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Admin/View/Finance/valueDetail.html | 24 +++++++++----------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/Application/Admin/View/Finance/valueDetail.html b/Application/Admin/View/Finance/valueDetail.html
index 60202cfdd..b894fbe00 100644
--- a/Application/Admin/View/Finance/valueDetail.html
+++ b/Application/Admin/View/Finance/valueDetail.html
@@ -96,61 +96,61 @@
- 账号ID |
+ 账号ID |
账号ID▼ |
账号ID▲ |
- 账号ID |
+ 账号ID |
玩家账号 |
- 平台币余额 |
+ 平台币余额 |
平台币余额▼ |
平台币余额▲ |
- 平台币余额 |
+ 平台币余额 |
- 平台币直充余额 |
+ 平台币直充余额 |
平台币直充余额▼ |
平台币直充余额▲ |
- 平台币直充余额 |
+ 平台币直充余额 |
- 平台币直充支出 |
+ 平台币直充支出 |
平台币直充支出▼ |
平台币直充支出▲ |
- 平台币直充支出 |
+ 平台币直充支出 |
- 平台币直充金额 |
+ 平台币直充金额 |
平台币直充金额▼ |
平台币直充金额▲ |
- 平台币直充金额 |
+ 平台币直充金额 |
- 后台发放平台币 |
+ 后台发放平台币 |
后台发放平台币▼ |
后台发放平台币▲ |
- 后台发放平台币 |
+ 后台发放平台币 |
操作 |
From 07c385e561c7a9d753e50a4f320bfee2c457ac87 Mon Sep 17 00:00:00 2001
From: sunke <18850253506@163.com>
Date: Mon, 13 Apr 2020 21:24:46 +0800
Subject: [PATCH 09/11] =?UTF-8?q?=E5=B9=B3=E5=8F=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Admin/Controller/FinanceController.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php
index f61e32448..74391e3d7 100644
--- a/Application/Admin/Controller/FinanceController.class.php
+++ b/Application/Admin/Controller/FinanceController.class.php
@@ -1335,7 +1335,7 @@ class FinanceController extends ThinkController
$map8[] = ['u.id = v.user_id'];
$map8['v.create_time'] = $map['create_time'];
- $valueQuery5 = M('value_detail_log', 'tab_')->alias('v')->field('sum(abs(v.value)) as spend_value')
+ $valueQuery5 = M('value_detail_log', 'tab_')->alias('v')->field('if(sum(abs(v.value)) != null, sum(abs(v.value)) , 0) as spend_value')
->where($map5)->buildSql();
$valueQuery6 = M('value_detail_log', 'tab_')->alias('v')->field('sum(v.value) as spend_value')
->where($map6)->buildSql();
From ae0e10166ac44b8ca9be6c7df034b93cb7fab528 Mon Sep 17 00:00:00 2001
From: sunke <18850253506@163.com>
Date: Mon, 13 Apr 2020 21:28:43 +0800
Subject: [PATCH 10/11] pt
---
Application/Admin/Controller/ExportController.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php
index 014419e59..b9fcf8234 100644
--- a/Application/Admin/Controller/ExportController.class.php
+++ b/Application/Admin/Controller/ExportController.class.php
@@ -2569,7 +2569,7 @@ class ExportController extends Controller
$map8[] = ['u.id = v.user_id'];
$map8['v.create_time'] = $map['create_time'];
- $valueQuery5 = M('value_detail_log', 'tab_')->alias('v')->field('sum(abs(v.value)) as spend_value')
+ $valueQuery5 = M('value_detail_log', 'tab_')->alias('v')->field('if(sum(abs(v.value)) != null, sum(abs(v.value)) , 0) as spend_value')
->where($map5)->buildSql();
$valueQuery6 = M('value_detail_log', 'tab_')->alias('v')->field('sum(v.value) as spend_value')
->where($map6)->buildSql();
From 163388e75cbcc158e2da37fee1316a6fbc0ea7dd Mon Sep 17 00:00:00 2001
From: sunke <18850253506@163.com>
Date: Tue, 14 Apr 2020 09:43:14 +0800
Subject: [PATCH 11/11] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=B8=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controller/ExportController.class.php | 20 +++++++++++++++----
.../Controller/FinanceController.class.php | 17 +++++++++++++---
2 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php
index b9fcf8234..48f9e40a7 100644
--- a/Application/Admin/Controller/ExportController.class.php
+++ b/Application/Admin/Controller/ExportController.class.php
@@ -2568,16 +2568,28 @@ class ExportController extends Controller
$map8[] = ['u.id = v.user_id'];
$map8['v.create_time'] = $map['create_time'];
+
+ $map9[] = ['u.id = v.user_id'];
+ $map9['v.pay_type'] = 3;
+ if (!empty($map['create_time'][1][1])) {
+ $map9['v.create_time'] = ['elt', $map['create_time'][1][1] ];
+ }
+ if (!empty($map['create_time'][1][0]) && empty($map['create_time'][1][1])) {
+ $map9['v.create_time'] = ['egt', $map['create_time'][1][0] ];
+ }
+
- $valueQuery5 = M('value_detail_log', 'tab_')->alias('v')->field('if(sum(abs(v.value)) != null, sum(abs(v.value)) , 0) as spend_value')
+ $valueQuery5 = M('value_detail_log', 'tab_')->alias('v')->field('IFNULL(sum(abs(v.value)), 0) as spend_value')
->where($map5)->buildSql();
$valueQuery6 = M('value_detail_log', 'tab_')->alias('v')->field('sum(v.value) as spend_value')
->where($map6)->buildSql();
$valueQuery7 = M('value_detail_log', 'tab_')->alias('v')->field('sum(v.value) as spend_value')
->where($map7)->buildSql();
$valueQuery8 = M('value_detail_log', 'tab_')->alias('v')->field('after_value')->where($map8)->order('create_time desc')->limit(1)->buildSql();
- $datas = M('user', 'tab_')->alias('u')->field("u.id, u.account, {$valueQuery8} as totalvalue, {$valueQuery5} as spendvalue, {$valueQuery6} as deposit, {$valueQuery7} as promoteCoin , if (({$valueQuery6}) - ({$valueQuery5}) > 0, ({$valueQuery6}) - ({$valueQuery5}), 0) as restvalue")->where($map)->limit(($i-1)*$perSize ,$perSize)->order('restvalue desc')->group('u.id')->select();
- $query = M('user', 'tab_')->alias('u')->field("u.id, u.account, {$valueQuery8} as totalvalue, {$valueQuery5} as spendvalue, {$valueQuery6} as deposit, {$valueQuery7} as promoteCoin , if (({$valueQuery6}) - ({$valueQuery5}) > 0, ({$valueQuery6}) - ({$valueQuery5}), 0) as restvalue")->where($map)->order('id desc')->group('u.id')->buildSql();
+ $valueQuery9 = M('value_detail_log', 'tab_')->alias('v')->field('IFNULL(sum(abs(v.value)), 0) as spend_value')
+ ->where($map9)->buildSql();
+ $datas = M('user', 'tab_')->alias('u')->field("u.id, u.account, {$valueQuery8} as totalvalue, {$valueQuery5} as spendvalue, {$valueQuery6} as deposit, {$valueQuery7} as promoteCoin , if (({$valueQuery8}) - ({$valueQuery9}) > 0, ({$valueQuery8}) - ({$valueQuery9}), 0) as restvalue")->where($map)->limit(($i-1)*$perSize ,$perSize)->order('restvalue desc')->group('u.id')->select();
+ $query = M('user', 'tab_')->alias('u')->field("u.id, u.account, {$valueQuery8} as totalvalue, {$valueQuery5} as spendvalue, {$valueQuery6} as deposit, {$valueQuery7} as promoteCoin , if (({$valueQuery8}) - ({$valueQuery9}) > 0, ({$valueQuery8}) - ({$valueQuery9}), 0) as restvalue")->where($map)->order('id desc')->group('u.id')->buildSql();
$allTotalValue1 = M()->alias('t')->table($query)->sum('t.totalvalue');
$allRestValue = M()->alias('rest')->table($query)->sum('rest.restvalue');
$allDatas = [];
@@ -2607,7 +2619,7 @@ class ExportController extends Controller
// $map7['pay_type'] = 3;
// $map7['create_time'] = $map['create_time'];
// $promoteCoin = M('value_detail_log', 'tab_')->where($map7)->sum('value');
- $promoteCoin = $data['promoteCoin'];
+ $promoteCoin = $data['promotecoin'];
if(empty($promoteCoin)) {
$promoteCoin = '0.00';
}
diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php
index 74391e3d7..1ce945076 100644
--- a/Application/Admin/Controller/FinanceController.class.php
+++ b/Application/Admin/Controller/FinanceController.class.php
@@ -1335,15 +1335,26 @@ class FinanceController extends ThinkController
$map8[] = ['u.id = v.user_id'];
$map8['v.create_time'] = $map['create_time'];
- $valueQuery5 = M('value_detail_log', 'tab_')->alias('v')->field('if(sum(abs(v.value)) != null, sum(abs(v.value)) , 0) as spend_value')
+ $map9[] = ['u.id = v.user_id'];
+ $map9['v.pay_type'] = 3;
+ if (!empty($map['create_time'][1][1])) {
+ $map9['v.create_time'] = ['elt', $map['create_time'][1][1] ];
+ }
+ if (!empty($map['create_time'][1][0]) && empty($map['create_time'][1][1])) {
+ $map9['v.create_time'] = ['egt', $map['create_time'][1][0] ];
+ }
+
+ $valueQuery5 = M('value_detail_log', 'tab_')->alias('v')->field('IFNULL(sum(abs(v.value)), 0) as spend_value')
->where($map5)->buildSql();
$valueQuery6 = M('value_detail_log', 'tab_')->alias('v')->field('sum(v.value) as spend_value')
->where($map6)->buildSql();
$valueQuery7 = M('value_detail_log', 'tab_')->alias('v')->field('sum(v.value) as spend_value')
->where($map7)->buildSql();
+ $valueQuery9 = M('value_detail_log', 'tab_')->alias('v')->field('IFNULL(sum(abs(v.value)), 0) as spend_value')
+ ->where($map9)->buildSql();
$valueQuery8 = M('value_detail_log', 'tab_')->alias('v')->field('after_value')->where($map8)->order('create_time desc')->limit(1)->buildSql();
- $datas = M('user', 'tab_')->alias('u')->field("u.id, u.account, {$valueQuery8} as totalvalue, {$valueQuery5} as spendvalue, {$valueQuery6} as deposit, {$valueQuery7} as promoteCoin , if (({$valueQuery6}) - ({$valueQuery5}) > 0, ({$valueQuery6}) - ({$valueQuery5}), 0) as restvalue")->where($map0)->page($page,$row)->order($order)->group('u.id')->select();
- $query = M('user', 'tab_')->alias('u')->field("u.id, u.account, {$valueQuery8} as totalvalue, {$valueQuery5} as spendvalue, {$valueQuery6} as deposit, {$valueQuery7} as promoteCoin , if (({$valueQuery6}) - ({$valueQuery5}) > 0, ({$valueQuery6}) - ({$valueQuery5}), 0) as restvalue")->where($map0)->order($order)->group('u.id')->buildSql();
+ $datas = M('user', 'tab_')->alias('u')->field("u.id, u.account, {$valueQuery8} as totalvalue, {$valueQuery5} as spendvalue, {$valueQuery6} as deposit, {$valueQuery7} as promoteCoin , if (({$valueQuery8}) - ({$valueQuery9}) > 0, ({$valueQuery8}) - ({$valueQuery9}), 0) as restvalue")->where($map0)->page($page,$row)->order($order)->group('u.id')->select();
+ $query = M('user', 'tab_')->alias('u')->field("u.id, u.account, {$valueQuery8} as totalvalue, {$valueQuery5} as spendvalue, {$valueQuery6} as deposit, {$valueQuery7} as promoteCoin , if (({$valueQuery8}) - ({$valueQuery9}) > 0, ({$valueQuery8}) - ({$valueQuery9}), 0) as restvalue")->where($map0)->order($order)->group('u.id')->buildSql();
$allTotalValue1 = M()->alias('t')->table($query)->sum('t.totalvalue');
$allRestValue = M()->alias('rest')->table($query)->sum('rest.restvalue');