From e1b93a987bd4242af07ebe2f54495ae4c7bcb7c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9C=E7=94=A8lww?= <“529520975@qq.com>
Date: Mon, 25 Nov 2019 11:36:04 +0800
Subject: [PATCH 01/20] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=E8=BF=87=E5=A4=A7=EF=BC=8C=E9=85=8D=E7=BD=AE=E5=8A=A0=E5=A4=A7?=
=?UTF-8?q?=E5=86=85=E5=AD=98=E9=99=90=E5=88=B6=E8=8C=83=E5=9B=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Admin/Controller/ExportController.class.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php
index 9f99ad237..a12055796 100644
--- a/Application/Admin/Controller/ExportController.class.php
+++ b/Application/Admin/Controller/ExportController.class.php
@@ -38,6 +38,7 @@ class ExportController extends Controller
//导出Excel
function expUser($id)
{
+ ini_set("memory_limit","256M"); //升级为256M内存
$xlsName = $_REQUEST['xlsname'];
switch ($id) {
case 1:
From f2c8986cd746ba8be8f2e57d1ee4f4abbab12990 Mon Sep 17 00:00:00 2001
From: chenxiaojun <956334972@qq.com>
Date: Mon, 25 Nov 2019 11:41:42 +0800
Subject: [PATCH 02/20] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=84=9A=E6=9C=AC->?=
=?UTF-8?q?=E7=8E=A9=E5=AE=B6=E8=A7=92=E8=89=B2=E5=85=85=E5=80=BC=E6=95=B0?=
=?UTF-8?q?=E6=8D=AE=E7=BB=9F=E8=AE=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Admin/Controller/AutoController.class.php | 58 ++++++++++++++-----
1 file changed, 43 insertions(+), 15 deletions(-)
diff --git a/Application/Admin/Controller/AutoController.class.php b/Application/Admin/Controller/AutoController.class.php
index b442ad320..272885e65 100644
--- a/Application/Admin/Controller/AutoController.class.php
+++ b/Application/Admin/Controller/AutoController.class.php
@@ -894,27 +894,55 @@ public function auto_rrdae(){
public function userPlayDataCount()
{
$time = strtotime(date('Y-m-d 00:00:00', time() - (3600 * 24)));
- $spendMap['pay_status'] = 1;
- $spendMap['pay_game_status'] = 1;
- $spendMap['game_player_id'] = ['gt', 0];
- $spendMap['pay_time'] = ['between', [$time, strtotime(date('Y-m-d 23:59:59', $time))]];
+ $res = M('user_play_data_count', 'tab_')->where(array('create_time' => $time))->find();
+ if (empty($res)) {
+ $spendMap['pay_status'] = 1;
+ $spendMap['pay_game_status'] = 1;
+ $spendMap['game_player_id'] = ['gt', 0];
+ $spendMap['pay_time'] = ['between', [$time, strtotime(date('Y-m-d 23:59:59', $time))]];
+
+ $this->userPlayDataCountByMap($spendMap);
+ }
+ }
+
+ //根据时间统计玩家充值--初始
+ public function userPlayDataCountInitial()
+ {
+ $res = M('user_play_data_count', 'tab_')->order('id asc')->find();
+ if (empty($res)) {
+ $time = strtotime(date('Y-m-d 00:00:00', time()));
+ $spendMap['pay_status'] = 1;
+ $spendMap['pay_game_status'] = 1;
+ $spendMap['game_player_id'] = ['gt', 0];
+ $spendMap['pay_time'] = ['lt', $time];
+
+ $this->userPlayDataCountByMap($spendMap);
+ echo '初始化成功';
+ } else {
+ echo '表存在记录,无法初始化';
+ }
+ }
+ private function userPlayDataCountByMap($map)
+ {
$field = 'FROM_UNIXTIME(pay_time, "%Y-%m-%d") as day,game_id,server_id,game_player_id,sum(pay_amount) as recharge_cost,count(id) as recharge_count';
$spendCostData = M('spend', 'tab_')->field($field)
- ->where($spendMap)
+ ->where($map)
->group('day,game_player_id,server_id,game_id')
->select();
- $data = [];
- foreach ($spendCostData as $list) {
- $save['game_id'] = $list['game_id'];
- $save['server_id'] = $list['server_id'];
- $save['role_id'] = $list['game_player_id'];
- $save['recharge_cost'] = $list['recharge_cost'];
- $save['recharge_count'] = $list['recharge_count'];
- $save['create_time'] = strtotime($list['day']);
- $data[] = $save;
+ if (!empty($spendCostData)) {
+ $data = [];
+ foreach ($spendCostData as $list) {
+ $save['game_id'] = $list['game_id'];
+ $save['server_id'] = $list['server_id'];
+ $save['role_id'] = $list['game_player_id'];
+ $save['recharge_cost'] = $list['recharge_cost'];
+ $save['recharge_count'] = $list['recharge_count'];
+ $save['create_time'] = strtotime($list['day']);
+ $data[] = $save;
+ }
+ M('user_play_data_count', 'tab_')->addAll($data);
}
- M('user_play_data_count', 'tab_')->addAll($data);
}
}
From 855e943ccb82c7b2367496e15e87f0c385d5eea4 Mon Sep 17 00:00:00 2001
From: chenxiaojun <956334972@qq.com>
Date: Mon, 25 Nov 2019 11:43:57 +0800
Subject: [PATCH 03/20] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=84=9A=E6=9C=AC->?=
=?UTF-8?q?=E7=8E=A9=E5=AE=B6=E8=A7=92=E8=89=B2=E5=85=85=E5=80=BC=E6=95=B0?=
=?UTF-8?q?=E6=8D=AE=E7=BB=9F=E8=AE=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Admin/Controller/AutoController.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Application/Admin/Controller/AutoController.class.php b/Application/Admin/Controller/AutoController.class.php
index 272885e65..4ad4af173 100644
--- a/Application/Admin/Controller/AutoController.class.php
+++ b/Application/Admin/Controller/AutoController.class.php
@@ -905,7 +905,7 @@ public function auto_rrdae(){
}
}
- //根据时间统计玩家充值--初始
+ //根据时间统计玩家充值--初始化
public function userPlayDataCountInitial()
{
$res = M('user_play_data_count', 'tab_')->order('id asc')->find();
From f75188f9526f720fa26d1b32315b936d6028f4c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9C=E7=94=A8lww?= <“529520975@qq.com>
Date: Mon, 25 Nov 2019 11:47:40 +0800
Subject: [PATCH 04/20] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E5=AF=BC=E5=87=BA?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=A2=9E=E5=8A=A0=E5=86=85=E5=AD=98=E9=99=90?=
=?UTF-8?q?=E5=88=B6=E5=88=B0512M?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Admin/Controller/ExportController.class.php | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php
index a12055796..15e65f361 100644
--- a/Application/Admin/Controller/ExportController.class.php
+++ b/Application/Admin/Controller/ExportController.class.php
@@ -5,6 +5,17 @@ use Think\Controller;
class ExportController extends Controller
{
+
+ /**
+ * ExportController constructor.
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ set_time_limit(0);
+ ini_set('memory_limit', '512M');
+ }
+
public function exportExcel($expTitle, $expCellName, $expTableData)
{
$xlsTitle = iconv('utf-8', 'gb2312', $expTitle);//文件名称
@@ -38,7 +49,6 @@ class ExportController extends Controller
//导出Excel
function expUser($id)
{
- ini_set("memory_limit","256M"); //升级为256M内存
$xlsName = $_REQUEST['xlsname'];
switch ($id) {
case 1:
@@ -5563,8 +5573,8 @@ if ($key == 'model'){
function gameFinanceDetail() {
- set_time_limit(0);
- ini_set('memory_limit', '512M');
+// set_time_limit(0);
+// ini_set('memory_limit', '512M');
$month = I("game_name");
$xlsName = $month.'充值流水';
From 3d3bfce9475f608062fe6f741247cdc267793665 Mon Sep 17 00:00:00 2001
From: chenxiaojun <956334972@qq.com>
Date: Mon, 25 Nov 2019 11:48:58 +0800
Subject: [PATCH 05/20] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=84=9A=E6=9C=AC->?=
=?UTF-8?q?=E7=8E=A9=E5=AE=B6=E8=A7=92=E8=89=B2=E5=85=85=E5=80=BC=E6=95=B0?=
=?UTF-8?q?=E6=8D=AE=E7=BB=9F=E8=AE=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Admin/Controller/AutoController.class.php | 45 +++++++++----------
1 file changed, 22 insertions(+), 23 deletions(-)
diff --git a/Application/Admin/Controller/AutoController.class.php b/Application/Admin/Controller/AutoController.class.php
index 4ad4af173..1c04e0d46 100644
--- a/Application/Admin/Controller/AutoController.class.php
+++ b/Application/Admin/Controller/AutoController.class.php
@@ -896,9 +896,6 @@ public function auto_rrdae(){
$time = strtotime(date('Y-m-d 00:00:00', time() - (3600 * 24)));
$res = M('user_play_data_count', 'tab_')->where(array('create_time' => $time))->find();
if (empty($res)) {
- $spendMap['pay_status'] = 1;
- $spendMap['pay_game_status'] = 1;
- $spendMap['game_player_id'] = ['gt', 0];
$spendMap['pay_time'] = ['between', [$time, strtotime(date('Y-m-d 23:59:59', $time))]];
$this->userPlayDataCountByMap($spendMap);
@@ -911,9 +908,6 @@ public function auto_rrdae(){
$res = M('user_play_data_count', 'tab_')->order('id asc')->find();
if (empty($res)) {
$time = strtotime(date('Y-m-d 00:00:00', time()));
- $spendMap['pay_status'] = 1;
- $spendMap['pay_game_status'] = 1;
- $spendMap['game_player_id'] = ['gt', 0];
$spendMap['pay_time'] = ['lt', $time];
$this->userPlayDataCountByMap($spendMap);
@@ -925,24 +919,29 @@ public function auto_rrdae(){
private function userPlayDataCountByMap($map)
{
- $field = 'FROM_UNIXTIME(pay_time, "%Y-%m-%d") as day,game_id,server_id,game_player_id,sum(pay_amount) as recharge_cost,count(id) as recharge_count';
- $spendCostData = M('spend', 'tab_')->field($field)
- ->where($map)
- ->group('day,game_player_id,server_id,game_id')
- ->select();
-
- if (!empty($spendCostData)) {
- $data = [];
- foreach ($spendCostData as $list) {
- $save['game_id'] = $list['game_id'];
- $save['server_id'] = $list['server_id'];
- $save['role_id'] = $list['game_player_id'];
- $save['recharge_cost'] = $list['recharge_cost'];
- $save['recharge_count'] = $list['recharge_count'];
- $save['create_time'] = strtotime($list['day']);
- $data[] = $save;
+ if (isset($map['pay_time'])) {
+ $map['pay_status'] = 1;
+ $map['pay_game_status'] = 1;
+ $map['game_player_id'] = ['gt', 0];
+ $field = 'FROM_UNIXTIME(pay_time, "%Y-%m-%d") as day,game_id,server_id,game_player_id,sum(pay_amount) as recharge_cost,count(id) as recharge_count';
+ $spendCostData = M('spend', 'tab_')->field($field)
+ ->where($map)
+ ->group('day,game_player_id,server_id,game_id')
+ ->select();
+
+ if (!empty($spendCostData)) {
+ $data = [];
+ foreach ($spendCostData as $list) {
+ $save['game_id'] = $list['game_id'];
+ $save['server_id'] = $list['server_id'];
+ $save['role_id'] = $list['game_player_id'];
+ $save['recharge_cost'] = $list['recharge_cost'];
+ $save['recharge_count'] = $list['recharge_count'];
+ $save['create_time'] = strtotime($list['day']);
+ $data[] = $save;
+ }
+ M('user_play_data_count', 'tab_')->addAll($data);
}
- M('user_play_data_count', 'tab_')->addAll($data);
}
}
}
From 30d9c305227f3361a14de9d9d4b58dde9c300248 Mon Sep 17 00:00:00 2001
From: chenxiaojun <956334972@qq.com>
Date: Mon, 25 Nov 2019 11:50:54 +0800
Subject: [PATCH 06/20] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=84=9A=E6=9C=AC->?=
=?UTF-8?q?=E7=8E=A9=E5=AE=B6=E8=A7=92=E8=89=B2=E5=85=85=E5=80=BC=E6=95=B0?=
=?UTF-8?q?=E6=8D=AE=E7=BB=9F=E8=AE=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Admin/Controller/AutoController.class.php | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Application/Admin/Controller/AutoController.class.php b/Application/Admin/Controller/AutoController.class.php
index 1c04e0d46..7a8902207 100644
--- a/Application/Admin/Controller/AutoController.class.php
+++ b/Application/Admin/Controller/AutoController.class.php
@@ -896,9 +896,9 @@ public function auto_rrdae(){
$time = strtotime(date('Y-m-d 00:00:00', time() - (3600 * 24)));
$res = M('user_play_data_count', 'tab_')->where(array('create_time' => $time))->find();
if (empty($res)) {
- $spendMap['pay_time'] = ['between', [$time, strtotime(date('Y-m-d 23:59:59', $time))]];
+ $map['pay_time'] = ['between', [$time, strtotime(date('Y-m-d 23:59:59', $time))]];
- $this->userPlayDataCountByMap($spendMap);
+ $this->userPlayDataCountByMap($map);
}
}
@@ -908,9 +908,9 @@ public function auto_rrdae(){
$res = M('user_play_data_count', 'tab_')->order('id asc')->find();
if (empty($res)) {
$time = strtotime(date('Y-m-d 00:00:00', time()));
- $spendMap['pay_time'] = ['lt', $time];
+ $map['pay_time'] = ['lt', $time];
- $this->userPlayDataCountByMap($spendMap);
+ $this->userPlayDataCountByMap($map);
echo '初始化成功';
} else {
echo '表存在记录,无法初始化';
From 3a867f60e3050cb8c0d5373dc8e472bd1776cb8c Mon Sep 17 00:00:00 2001
From: chenxiaojun <956334972@qq.com>
Date: Mon, 25 Nov 2019 11:59:04 +0800
Subject: [PATCH 07/20] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=84=9A=E6=9C=AC->?=
=?UTF-8?q?=E7=8E=A9=E5=AE=B6=E8=A7=92=E8=89=B2=E5=85=85=E5=80=BC=E6=95=B0?=
=?UTF-8?q?=E6=8D=AE=E7=BB=9F=E8=AE=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Admin/Controller/AutoController.class.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Application/Admin/Controller/AutoController.class.php b/Application/Admin/Controller/AutoController.class.php
index 7a8902207..8bdd063ae 100644
--- a/Application/Admin/Controller/AutoController.class.php
+++ b/Application/Admin/Controller/AutoController.class.php
@@ -924,14 +924,14 @@ public function auto_rrdae(){
$map['pay_game_status'] = 1;
$map['game_player_id'] = ['gt', 0];
$field = 'FROM_UNIXTIME(pay_time, "%Y-%m-%d") as day,game_id,server_id,game_player_id,sum(pay_amount) as recharge_cost,count(id) as recharge_count';
- $spendCostData = M('spend', 'tab_')->field($field)
+ $spendData = M('spend', 'tab_')->field($field)
->where($map)
->group('day,game_player_id,server_id,game_id')
->select();
- if (!empty($spendCostData)) {
+ if (!empty($spendData)) {
$data = [];
- foreach ($spendCostData as $list) {
+ foreach ($spendData as $list) {
$save['game_id'] = $list['game_id'];
$save['server_id'] = $list['server_id'];
$save['role_id'] = $list['game_player_id'];
From b52113622d2d8f4f419ae040e0e58b34b8990095 Mon Sep 17 00:00:00 2001
From: chenzhi <“chenzhi063@qq.com>
Date: Mon, 25 Nov 2019 14:08:48 +0800
Subject: [PATCH 08/20] =?UTF-8?q?[bug]=E6=97=A0=E6=B3=95=E8=8E=B7=E5=8F=96?=
=?UTF-8?q?=E4=B8=8A=E7=BA=BF=E6=8E=A8=E5=B9=BF=E5=91=98=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Admin/Common/extend.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php
index 9281b6a0c..14903a25e 100644
--- a/Application/Admin/Common/extend.php
+++ b/Application/Admin/Common/extend.php
@@ -1064,7 +1064,7 @@ function get_promote_parent($promote_id,$field='account'){
function get_promote_parent_acc($promote_id){
$Promote = M('promote','tab_');
- $data = $Promote->field('account,parent_id')->find($promote_id);
+ $data = $Promote->field('account,parent_id,chain')->find($promote_id);
if(empty($data)){
return $data["account"]="官方渠道";exit;
From e35ada1a5d0217a1d416d998974227db068a0bec Mon Sep 17 00:00:00 2001
From: chenxiaojun <956334972@qq.com>
Date: Mon, 25 Nov 2019 15:25:03 +0800
Subject: [PATCH 09/20] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?=
=?UTF-8?q?=E7=AE=A1=E7=90=86=E4=B8=AD=E5=BF=83->=E7=BC=96=E8=BE=91--?=
=?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Home/Controller/QueryController.class.php | 12 +--
.../Home/View/default/Promote/addPromote.html | 2 +-
.../Home/View/default/Promote/edit_chlid.html | 90 +------------------
3 files changed, 9 insertions(+), 95 deletions(-)
diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php
index 8b2338baa..59b2f1a13 100644
--- a/Application/Home/Controller/QueryController.class.php
+++ b/Application/Home/Controller/QueryController.class.php
@@ -1308,15 +1308,15 @@ class QueryController extends BaseController
$allData['spend_user_num'] = $spendRepository->getPayUserCountByGame($params);//充值人数
$allData['spend_num'] = $spendRepository->getPayCountByGame($params);//充值次数
unset($params['pay_way']);
- $allData['spend_all_amount'] = $spendRepository->getPayAmountByGameAndType($params);//充值总额
+ $allData['spend_all_amount'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//充值总额
$params['pay_way'] = ['in', '1,2,3,4,5,6'];
- $allData['spend_cash'] = $spendRepository->getPayAmountByGameAndType($params);//现金充值
+ $allData['spend_cash'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//现金充值
$params['pay_way'] = 0;
- $allData['spend_generic'] = $spendRepository->getPayAmountByGameAndType($params);//通用币充值
+ $allData['spend_generic'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//通用币充值
$params['pay_way'] = -1;
- $allData['spend_binding'] = $spendRepository->getPayAmountByGameAndType($params);//绑定币充值
- $allData['spend_discount'] = 0;
- $allData['spend_voucher'] = 0;
+ $allData['spend_binding'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//绑定币充值
+ $allData['spend_discount'] = '0.00';
+ $allData['spend_voucher'] = '0.00';
}
}
diff --git a/Application/Home/View/default/Promote/addPromote.html b/Application/Home/View/default/Promote/addPromote.html
index f7efe5517..e718cc779 100644
--- a/Application/Home/View/default/Promote/addPromote.html
+++ b/Application/Home/View/default/Promote/addPromote.html
@@ -77,7 +77,7 @@
|
-
+
返回
|
diff --git a/Application/Home/View/default/Promote/edit_chlid.html b/Application/Home/View/default/Promote/edit_chlid.html
index 46df37f5f..28da228f8 100644
--- a/Application/Home/View/default/Promote/edit_chlid.html
+++ b/Application/Home/View/default/Promote/edit_chlid.html
@@ -16,7 +16,7 @@
@@ -26,101 +26,54 @@
@@ -128,21 +81,13 @@
From 3cfe2c163df41e3951094f153625e96158a2f867 Mon Sep 17 00:00:00 2001
From: chenxiaojun <956334972@qq.com>
Date: Mon, 25 Nov 2019 15:37:31 +0800
Subject: [PATCH 10/20] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?=
=?UTF-8?q?=E7=AE=A1=E7=90=86=E4=B8=AD=E5=BF=83->=E7=BC=96=E8=BE=91--?=
=?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Home/View/default/Promote/edit_chlid.html | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/Application/Home/View/default/Promote/edit_chlid.html b/Application/Home/View/default/Promote/edit_chlid.html
index 28da228f8..bd2ed231c 100644
--- a/Application/Home/View/default/Promote/edit_chlid.html
+++ b/Application/Home/View/default/Promote/edit_chlid.html
@@ -14,12 +14,7 @@
From cc4a07119423def97bc1e1b90ba8db379666c1a3 Mon Sep 17 00:00:00 2001
From: zhengyongxing
Date: Mon, 25 Nov 2019 16:23:33 +0800
Subject: [PATCH 11/20] =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF?=
=?UTF-8?q?=E5=A4=A7=E6=95=B0=E6=8D=AE=E9=87=8F=E5=AF=BC=E5=87=BA=E9=94=99?=
=?UTF-8?q?=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controller/ExportController.class.php | 246 ++++++++++++------
1 file changed, 170 insertions(+), 76 deletions(-)
diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php
index 15e65f361..d7b5c79a2 100644
--- a/Application/Admin/Controller/ExportController.class.php
+++ b/Application/Admin/Controller/ExportController.class.php
@@ -197,40 +197,53 @@ class ExportController extends Controller
break;
case 3:
if($_REQUEST['type']==2){
- $xlsCell = array(
- array('id', L('Account_number_ID')),
- array('register_type', L('Third_party_source'), "get_registertype", '*'),
- array('account', "玩家账号"),
- array('promote_account', L('Subordinate_channel')),
- array('balance', "账户平台币"),
- array('recharge_total', "累计充值"),
- array('gold_coin', "金币"),
- array('alipay', "绑定支付宝"),
- array('small_count', "小号"),
- array('vip_level', "VIP等级"),
- array('register_time', L('Registration_time'), 'time_format', '*'),
- array('login_time', "最后登录时间", 'time_format', '*'),
- array('register_ip', L('Register_iP')),
- array('lock_status', L('Account_status'), 'get_info_status', '*', '4'),
- );
+// $xlsCell = array(
+// array('id', L('Account_number_ID')),
+// array('register_type', L('Third_party_source'), "get_registertype", '*'),
+// array('account', "玩家账号"),
+// array('promote_account', L('Subordinate_channel')),
+// array('balance', "账户平台币"),
+// array('recharge_total', "累计充值"),
+// array('gold_coin', "金币"),
+// array('alipay', "绑定支付宝"),
+// array('small_count', "小号"),
+// array('vip_level', "VIP等级"),
+// array('register_time', L('Registration_time'), 'time_format', '*'),
+// array('login_time', "最后登录时间", 'time_format', '*'),
+// array('register_ip', L('Register_iP')),
+// array('lock_status', L('Account_status'), 'get_info_status', '*', '4'),
+// );
+ $field = 'tab_user.id,tab_user.register_type,tab_user.account,tab_user.promote_account,tab_user.balance
+ ,IFNULL(sum(ss.pay_amount),0) AS recharge_total,tab_user.gold_coin,tab_user.alipay,tab_user.id as small_count,
+ tab_user.id as vip_level,register_time,tab_user.login_time,tab_user.register_ip,tab_user.lock_status,
+ tab_user.age_status,tab_user.register_way';
+ $xlsCell = [L('Account_number_ID'),L('Third_party_source'),"玩家账号",L('Subordinate_channel'), "账户平台币"
+ , "累计充值", "金币", "绑定支付宝", "小号", "VIP等级", L('Registration_time'), "最后登录时间", L('Register_iP'), L('Account_status')];
$map['tab_user.register_type']= ['in','3,4,5,6'];
}else{
- $xlsCell = array(
- array('id', L('Account_number_ID')),
- array('account', "玩家账号"),
- array('promote_account', L('Subordinate_channel')),
- array('balance', "账户平台币"),
- array('recharge_total', "累计充值"),
- array('gold_coin', "金币"),
- array('alipay', "绑定支付宝"),
- array('small_count', "小号"),
- array('vip_level', "VIP等级"),
- array('register_type', "注册方式"),
- array('register_time', L('Registration_time'), 'time_format', '*'),
- array('login_time', "最后登录时间", 'time_format', '*'),
- array('register_ip', L('Register_iP')),
- array('lock_status', L('Account_status'), 'get_info_status', '*', '4'),
- );
+// $xlsCell = array(
+// array('id', L('Account_number_ID')),
+// array('account', "玩家账号"),
+// array('promote_account', L('Subordinate_channel')),
+// array('balance', "账户平台币"),
+// array('recharge_total', "累计充值"),
+// array('gold_coin', "金币"),
+// array('alipay', "绑定支付宝"),
+// array('small_count', "小号"),
+// array('vip_level', "VIP等级"),
+// array('register_type', "注册方式"),
+// array('register_time', L('Registration_time'), 'time_format', '*'),
+// array('login_time', "最后登录时间", 'time_format', '*'),
+// array('register_ip', L('Register_iP')),
+// array('lock_status', L('Account_status'), 'get_info_status', '*', '4'),
+// );
+ $field = 'tab_user.id,tab_user.account,tab_user.promote_account,tab_user.balance,
+ IFNULL(sum(ss.pay_amount),0) AS recharge_total,tab_user.gold_coin,tab_user.alipay
+ ,tab_user.id as small_count,tab_user.id as vip_level,tab_user.register_type,register_time,tab_user.login_time
+ ,tab_user.register_ip,tab_user.lock_status,tab_user.age_status,tab_user.register_way';
+ $xlsCell = [L('Account_number_ID'),"玩家账号",L('Subordinate_channel'), "账户平台币"
+ , "累计充值", "金币", "绑定支付宝", "小号", "VIP等级", "注册方式", L('Registration_time'),
+ "最后登录时间", L('Register_iP'), L('Account_status')];
$map['tab_user.register_type']=['in','1,2'];
$map['tab_user.register_type']=['in','0,1,2,7'];
@@ -286,6 +299,8 @@ class ExportController extends Controller
$maps['tab_user.register_type'] = 2;
}
} else {
+
+
$map['register_way'] = I('register_way');
unset($_REQUEST['register_way']);
}
@@ -320,62 +335,141 @@ class ExportController extends Controller
$map['puid'] = array('eq',0);
$map['is_platform'] = 0;
+
+ set_time_limit(0);
+// $columns = [
+// '序号ID', '姓名', '电话',
+// ];
+
+ $fileName = '导出.xlsx';
+ $csvFileName = $xlsName.'.csv';
+ //设置好告诉浏览器要下载excel文件的headers
+ header('Content-Description: File Transfer');
+ header('Content-Type: application/vnd.ms-excel');
+ header('Content-Disposition: attachment; filename="'. $csvFileName .'"');
+ header('Expires: 0');
+ header('Cache-Control: must-revalidate');
+ header('Pragma: public');
+ $fp = fopen('php://output', 'a');//打开output流
+ mb_convert_variables('GBK', 'UTF-8', $xlsCell);
+ fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中
+
+ $accessNum = '100000';//从数据库获取总量,假设是十万
if($_REQUEST['promote_id'] && $_REQUEST['promote_id'] > -1){
- $xlsData = M('user', 'tab_')->field('tab_user.id,tab_user.age_status,tab_user.account,tab_user.gold_coin,tab_user.alipay,tab_user.balance,tab_user.promote_account,register_time,tab_user.lock_status,tab_user.register_way,tab_user.register_type,tab_user.register_ip,tab_user.login_time,IFNULL(sum(ss.pay_amount),0) AS recharge_total')
- ->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1'.$spendprom)
- ->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false)
- ->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = tab_user.id $game_play_map" : false)
- ->where($map)
- ->group('tab_user.id')
- ->order($order)
- ->having($havs)
- ->select();
+ $accessNum = M('user', 'tab_')
+ ->field('IFNULL(sum(ss.pay_amount),0) AS recharge_total,count(tab_user.id) as count')
+// ->field($field)
+ ->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1'.$spendprom)
+ ->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false)
+ ->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = tab_user.id $game_play_map" : false)
+ ->where($map)
+ ->group('tab_user.id')
+ ->having($havs)
+ ->select(false);
+ $sql = "select count(t.count) as count from ({$accessNum}) as t ";
+ $accessNum = M('user', 'tab_')->query($sql);
}else{
- $xlsData = M('user', 'tab_')->field('tab_user.id,tab_user.age_status,tab_user.account,tab_user.gold_coin,tab_user.alipay,tab_user.balance,tab_user.promote_account,register_time,tab_user.lock_status,tab_user.register_way,tab_user.register_type,tab_user.register_ip,tab_user.login_time,IFNULL(sum(ss.pay_amount),0) AS recharge_total')
- ->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1')
- ->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false)
- ->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = tab_user.id $game_play_map" : false)
- ->where($map)
- ->group('tab_user.id')
- ->order($order)
- ->having($havs)
- ->select();
+ $accessNum = M('user', 'tab_')
+// ->field('tab_user.id,tab_user.age_status,tab_user.account,tab_user.gold_coin,tab_user.alipay,tab_user.balance,tab_user.promote_account,register_time,tab_user.lock_status,tab_user.register_way,tab_user.register_type,tab_user.register_ip,tab_user.login_time,IFNULL(sum(ss.pay_amount),0) AS recharge_total')
+ ->field('IFNULL(sum(ss.pay_amount),0) AS recharge_total,count(tab_user.id) as count')
+ ->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1')
+ ->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false)
+ ->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = tab_user.id $game_play_map" : false)
+ ->where($map)
+ ->group('tab_user.id')
+ ->having($havs)
+ ->select(false);
+
+ $sql = "select count(t.count) as count from ({$accessNum}) as t ";
+ $accessNum = M('user', 'tab_')->query($sql);
}
- //数据
-
-
- if($xlsData) {
- $ids = array_column($xlsData,'id');
- /* 在手里 */
- $small = M('user','tab_')->field('count(id) as count,puid')->where(['puid'=>array('in',$ids)])->group('puid')->select();
- /* 出售中 */
- $small2 = M('user','tab_')->field('count(id) as count,source_puid')->where(['source_puid'=>array('in',$ids),'source_time'=>0])->group('source_puid')->select();
-
- foreach($xlsData as $k => $v) {
-
-
- $xlsData[$k]['vip_level'] = get_vip_level($v['recharge_total']);
- if(empty($v['alipay'])){
- $xlsData[$k]['alipay'] = '--';
- }
- $xlsData[$k]['register_type'] = $v['register_type'] == 2?'手机号':($v['register_type']==7?'邮箱':'账号');
+ $accessNum = $accessNum[0]['count'];
+ $perSize = 5000;//每次查询的条数
+ $pages = ceil($accessNum / $perSize);
+ $lastId = 0;
+ for($i = 1; $i <= $pages; $i++) {
+
+ if($_REQUEST['promote_id'] && $_REQUEST['promote_id'] > -1){
+ $xlsData = M('user', 'tab_')
+// ->field('tab_user.id,tab_user.age_status,tab_user.account,tab_user.gold_coin,tab_user.alipay,tab_user.balance,tab_user.promote_account,register_time,tab_user.lock_status,tab_user.register_way,tab_user.register_type,tab_user.register_ip,tab_user.login_time,IFNULL(sum(ss.pay_amount),0) AS recharge_total')
+ ->field($field)
+ ->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1'.$spendprom)
+ ->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false)
+ ->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = tab_user.id $game_play_map" : false)
+ ->where($map)
+ ->limit(($i-1)*$perSize ,$perSize)
+ ->group('tab_user.id')
+ ->order($order)
+ ->having($havs)
+ ->select();
+ }else{
+ $xlsData = M('user', 'tab_')
+// ->field('tab_user.id,tab_user.age_status,tab_user.account,tab_user.gold_coin,tab_user.alipay,tab_user.balance,tab_user.promote_account,register_time,tab_user.lock_status,tab_user.register_way,tab_user.register_type,tab_user.register_ip,tab_user.login_time,IFNULL(sum(ss.pay_amount),0) AS recharge_total')
+ ->field($field)
+ ->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1')
+ ->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false)
+ ->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = tab_user.id $game_play_map" : false)
+ ->where($map)
+ ->limit(($i-1)*$perSize ,$perSize)
+ ->group('tab_user.id')
+ ->order($order)
+ ->having($havs)
+ ->select();
+ }
+ //数据
+
+
+ if($xlsData) {
+ $ids = array_column($xlsData,'id');
+ /* 在手里 */
+ $small = M('user','tab_')->field('count(id) as count,puid')->where(['puid'=>array('in',$ids)])->group('puid')->select();
+ /* 出售中 */
+ $small2 = M('user','tab_')->field('count(id) as count,source_puid')->where(['source_puid'=>array('in',$ids),'source_time'=>0])->group('source_puid')->select();
- $xlsData[$k]['small_count'] = 0;
- foreach($small as $s) {
- if($s['puid'] == $v['id']) {
- $xlsData[$k]['small_count'] += $s['count'];break;
+ foreach($xlsData as $k => $v) {
+
+
+ $xlsData[$k]['vip_level'] = get_vip_level($v['recharge_total']);
+ if(empty($v['alipay'])){
+ $xlsData[$k]['alipay'] = '--';
}
- }
- foreach($small2 as $s) {
- if($s['source_puid'] == $v['id']) {
- $xlsData[$k]['small_count'] += $s['count'];break;
+
+ $xlsData[$k]['register_time'] = date('Y-m-d H:i:s',$xlsData[$k]['register_time']);
+ $xlsData[$k]['login_time'] = date('Y-m-d H:i:s',$xlsData[$k]['login_time']);
+ $xlsData[$k]['lock_status'] = $xlsData[$k]['lock_status']==1?'正常':'锁定';
+
+ $xlsData[$k]['register_type'] = $v['register_type'] == 2?'手机号':($v['register_type']==7?'邮箱':'账号');
+
+ $xlsData[$k]['small_count'] = 0;
+ foreach($small as $s) {
+ if($s['puid'] == $v['id']) {
+ $xlsData[$k]['small_count'] += $s['count'];break;
+ }
}
+ foreach($small2 as $s) {
+ if($s['source_puid'] == $v['id']) {
+ $xlsData[$k]['small_count'] += $s['count'];break;
+ }
+ }
+ unset($xlsData[$k]['age_status']);
+ unset($xlsData[$k]['register_way']);
}
}
+ foreach($xlsData as $value) {
+ mb_convert_variables('GBK', 'UTF-8', $value);
+ fputcsv($fp, $value);
+ $lastId = $value['id'];
+ }
+ unset($xlsData);//释放变量的内存
+ //刷新输出缓冲到浏览器
+ ob_flush();
+ flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。
}
+ fclose($fp);
+ exit();
break;
case 4:
From 585057f98e642dd609804c15d8aec72a45c46fec Mon Sep 17 00:00:00 2001
From: chenxiaojun <956334972@qq.com>
Date: Mon, 25 Nov 2019 16:24:20 +0800
Subject: [PATCH 12/20] =?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=A7=92=E8=89=B2?=
=?UTF-8?q?=E6=9F=A5=E8=AF=A2|=E5=85=85=E5=80=BC=E7=8E=A9=E5=AE=B6|?=
=?UTF-8?q?=E5=9B=A2=E9=98=9F/=E6=8E=A8=E5=B9=BF=E5=91=98=E4=B8=9A?=
=?UTF-8?q?=E7=BB=A9--=E6=A3=80=E7=B4=A2=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Home/Controller/QueryController.class.php | 61 +++++++++------
.../Home/View/default/Query/achievement.html | 74 ++++++++++---------
.../View/default/Query/userRecharges.html | 32 ++++----
.../Home/View/default/Query/userRoles.html | 74 ++++++++++---------
4 files changed, 131 insertions(+), 110 deletions(-)
diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php
index 59b2f1a13..50e8def6c 100644
--- a/Application/Home/Controller/QueryController.class.php
+++ b/Application/Home/Controller/QueryController.class.php
@@ -1603,7 +1603,7 @@ class QueryController extends BaseController
public function userRoles()
{
- $gameId = I('game_id', 0);
+ $relationGameId = I('relation_game_id', 0);
$serverId = I('server_id', 0);
$isSelf = I('is_self', 0);
$roleName = I('role_name', '');
@@ -1633,8 +1633,13 @@ class QueryController extends BaseController
$map['_string'] = '1<>1';
}
- if ($gameId != 0) {
- $map['game_id'] = $gameId;
+ if ($relationGameId != 0) {
+ $gameMap['relation_game_id'] = $relationGameId;
+ if ($sdkVersion != 0) {
+ $gameMap['sdk_version'] = $sdkVersion;
+ }
+ $gameId = M('game', 'tab_')->where($gameMap)->getField('id', true);
+ $map['game_id'] = ['in', $gameId];
}
if ($serverId != 0) {
$map['server_id'] = $serverId;
@@ -1645,9 +1650,6 @@ class QueryController extends BaseController
if ($userAccount != '') {
$map['user_account'] = ['like', '%' . $userAccount . '%'];
}
- if ($sdkVersion != 0) {
- $map['sdk_version'] = $sdkVersion;
- }
if ($roleLevelBegin != 0 && $roleLevelEnd == 0) {
$map['role_level'] = ['egt', $roleLevelBegin];
} elseif ($roleLevelEnd != 0 && $roleLevelBegin == 0) {
@@ -1693,7 +1695,7 @@ class QueryController extends BaseController
}
- $games = $this->getGamesByPromote($promote);
+ $games = get_promote_serach_game();
$this->assign('games', $games);
$this->assign('records', $records);
@@ -1704,7 +1706,7 @@ class QueryController extends BaseController
public function userRecharges()
{
- $gameId = I('game_id', 0);
+ $relationGameId = I('relation_game_id', 0);
$serverId = I('server_id', 0);
$isSelf = I('is_self', 0);
$roleName = I('role_name', '');
@@ -1748,9 +1750,14 @@ class QueryController extends BaseController
}
$subMap = [];
- if ($gameId != 0) {
- $map['game_id'] = $gameId;
- $subMap['game_id'] = $gameId;
+ if ($relationGameId != 0) {
+ $gameMap['relation_game_id'] = $relationGameId;
+ if ($sdkVersion != 0) {
+ $gameMap['sdk_version'] = $sdkVersion;
+ }
+ $gameId = M('game', 'tab_')->where($gameMap)->getField('id', true);
+ $map['game_id'] = ['in', $gameId];
+ $subMap['game_id'] = ['in', $gameId];
}
if ($serverId != 0) {
$map['server_id'] = $serverId;
@@ -1762,9 +1769,6 @@ class QueryController extends BaseController
if ($userAccount != '') {
$map['user_account'] = ['like', '%' . $userAccount . '%'];
}
- if ($sdkVersion != 0) {
- $map['sdk_version'] = $sdkVersion;
- }
if ($isSelf) {
$map['promote_id'] = $queryPromote['id'];
}
@@ -1865,7 +1869,7 @@ class QueryController extends BaseController
}
}
- $games = $this->getGamesByPromote($promote);
+ $games = get_promote_serach_game();
$this->assign('games', $games);
$this->assign('records', $records);
@@ -1894,7 +1898,16 @@ class QueryController extends BaseController
public function getGameServers()
{
$gameId = I('game_id', 0);
- $servers = M('server', 'tab_')->field(['id', 'server_id', 'server_name'])->where(['game_id' => $gameId])->order('server_id asc')->select();
+ $sdkVersion = I('sdk_version', 0);
+ $servers = [];
+ if (!empty($gameId)) {
+ $map['relation_game_id'] = $gameId;
+ if (in_array($sdkVersion, [1, 2])) {
+ $map['sdk_version'] = $sdkVersion;
+ }
+ $gameIds = M('game', 'tab_')->where($map)->getField('id', true);
+ $servers = M('server', 'tab_')->field(['id', 'server_id', 'server_name'])->where(['game_id' => ['in', $gameIds]])->order('server_id asc')->select();
+ }
$this->ajaxReturn([
'status' => 1,
'msg' => '成功',
@@ -1965,7 +1978,7 @@ class QueryController extends BaseController
$defaultTime = date('Y-m-d', time());
}
$sdkVersion = I('sdk_version', 0);
- $gameId = I('game_id', 0);
+ $relationGameId = I('relation_game_id', 0);
$serverId = I('server_id', 0);
$parentId = I('parent_id', 0);
$promoteId = I('promote_id', 0);
@@ -1990,7 +2003,7 @@ class QueryController extends BaseController
$searchLevel = $parent['level'] + 1;
$searchLevelName = $promoteService->getLevelName($searchLevel);
- $games = $this->getGamesByPromote($parent);
+ $games = get_promote_serach_game();
$subPromotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $parent['id']])->select();
@@ -2024,15 +2037,17 @@ class QueryController extends BaseController
'isContainSubs' => true,
'basicPromotes' => $basicPromotes,
];
- if ($gameId > 0) {
- $params['game_id'] = $gameId;
+ if ($relationGameId > 0) {
+ $gameMap['relation_game_id'] = $relationGameId;
+ if ($sdkVersion > 0) {
+ $gameMap['sdk_version'] = $sdkVersion;
+ }
+ $gameId = M('game', 'tab_')->where($gameMap)->getField('id', true);
+ $params['game_id'] = ['in', $gameId];
}
if ($serverId > 0) {
$params['server_id'] = $serverId;
}
- if ($sdkVersion > 0) {
- $params['sdk_version'] = $sdkVersion;
- }
if ($status > 0) {
$params['lock_status'] = $status;
}
diff --git a/Application/Home/View/default/Query/achievement.html b/Application/Home/View/default/Query/achievement.html
index 68699376b..06106905f 100644
--- a/Application/Home/View/default/Query/achievement.html
+++ b/Application/Home/View/default/Query/achievement.html
@@ -26,25 +26,25 @@