From 410a3cda1b4f151a9fe5bd681999c7cf5e98866d Mon Sep 17 00:00:00 2001
From: chenxiaojun <956334972@qq.com>
Date: Thu, 19 Dec 2019 17:58:54 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0>?=
=?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98=E7=AE=A1=E7=90=86>=E5=85=AC?=
=?UTF-8?q?=E4=BC=9A=E5=88=86=E6=88=90=E7=AE=A1=E7=90=86--=E6=9B=B4?=
=?UTF-8?q?=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../PromoteGameRatioController.class.php | 77 ++++++++++++++-----
.../View/PromoteGameRatio/applyRatio.html | 71 +++++++++++------
.../Admin/View/PromoteGameRatio/lists.html | 2 +-
Application/Common/Common/extend.php | 50 +++++++++++-
Data/update.sql | 4 +-
5 files changed, 156 insertions(+), 48 deletions(-)
diff --git a/Application/Admin/Controller/PromoteGameRatioController.class.php b/Application/Admin/Controller/PromoteGameRatioController.class.php
index c08d958a8..05bedf223 100644
--- a/Application/Admin/Controller/PromoteGameRatioController.class.php
+++ b/Application/Admin/Controller/PromoteGameRatioController.class.php
@@ -66,15 +66,13 @@ class PromoteGameRatioController extends ThinkController
$thisPromoteVerStatus = '未知';
$thisGameName = '未知';
$thisGameRatio = '0.00';
+ $thisLastRatio = $promoteGameRatio['last_ratio'];
+ $thisLastRatioStatus = $promoteGameRatio['last_ratio_status'];
$thisStatusText = self::$statusList[$promoteGameRatio['status']];
$thisStatusText = ($promoteGameRatio['status'] == -1) ? '' . $thisStatusText . '' : $thisStatusText;
$thisApplicant = getPromoteAccount($promoteGameRatio['applicant_id']);
$thisReviewer = $promoteGameRatio['reviewer_id'] ? getPromoteAccount($promoteGameRatio['reviewer_id']) : '待确认';
- if ($promoteGameRatio['ratio'] > 0 && $promoteGameRatio['begin_time']) {
- $thisBeninTime = date('Y/m/d', $promoteGameRatio['begin_time']);
- } else {
- $thisBeninTime = date('Y/m/d', $this->getPromoteApplyCreateTime($thisPromoteId, $thisGameId));
- }
+ $thisBeninTime = date('Y/m/d', $promoteGameRatio['begin_time']);
$thisEndTime = $promoteGameRatio['end_time'] ? date('Y/m/d', $promoteGameRatio['end_time']) : '永久';
$validDate = $thisBeninTime . ' - ' . $thisEndTime;
if ($issetPromote) {
@@ -100,7 +98,7 @@ class PromoteGameRatioController extends ThinkController
'promote_status_text' => $thisPromoteStatus,
'promote_ver_status_text' => $thisPromoteVerStatus,
'game_name' => $thisGameName,
- 'game_ratio' => $thisGameRatio . '%',
+ 'last_ratio' => (($thisLastRatioStatus == 1) ? $thisLastRatio : $thisGameRatio) . '%',
'ratio' => $promoteGameRatio['ratio'] . '%',
'valid_date' => $validDate,
'remark' => $promoteGameRatio['remark'],
@@ -129,8 +127,11 @@ class PromoteGameRatioController extends ThinkController
if ($_POST) {
$params = I('post.');
$time = time();
+ if (empty($params['begin_time'])) {
+ $this->error('请选择开始时间');
+ }
$save['ratio'] = $params['ratio'] ?? 0;
- $save['begin_time'] = $params['begin_time'] ? strtotime($params['begin_time']) : 0;
+ $save['begin_time'] = strtotime($params['begin_time']);
$save['end_time'] = $params['end_time'] ? strtotime($params['end_time']) : 0;
$save['remark'] = $params['remark'] ?? '';
$save['status'] = 0;
@@ -140,6 +141,10 @@ class PromoteGameRatioController extends ThinkController
if (empty($promoteGameRatio)) {
$this->error('参数异常');
}
+ if ($promoteGameRatio['status'] == 1) {
+ $save['last_ratio'] = $promoteGameRatio['ratio'];
+ $save['last_ratio_status'] = 1;
+ }
$save['id'] = intval($params['id']);
$result = D(self::MODEL_NAME)->save($save);
} else {//新增
@@ -176,19 +181,22 @@ class PromoteGameRatioController extends ThinkController
$metaTitle = '游戏分成比例申请';
if ($id) {
$metaTitle .= '--修改';
- $field = 'id, promote_id, game_id, ratio, begin_time, end_time, remark';
$map['id'] = $id;
- $promoteGameRatio = D(self::MODEL_NAME)->field($field)->where($map)->find();
+ $promoteGameRatio = D(self::MODEL_NAME)->where($map)->find();
if (empty($promoteGameRatio)) {
$this->error('数据异常');
}
$promoteGameRatio['begin_time'] = $promoteGameRatio['begin_time'] ? date('Y-m-d', $promoteGameRatio['begin_time']) : '';
$promoteGameRatio['end_time'] = $promoteGameRatio['end_time'] ? date('Y-m-d', $promoteGameRatio['end_time']) : '';
- $gameRatio = M('game', 'tab_')->where(array(['id' => $promoteGameRatio['game_id']]))->getField('ratio');
- $gameRatio = ($gameRatio ?? '0.00') . '%';
+ if ($promoteGameRatio['last_ratio_status'] == 1) {
+ $lastRatio = $promoteGameRatio['last_ratio'];
+ } else {
+ $gameRatio = M('game', 'tab_')->where(array(['id' => $promoteGameRatio['game_id']]))->getField('ratio');
+ $lastRatio = ($gameRatio ?? '0.00') . '%';
+ }
$this->assign('record', $promoteGameRatio);
- $this->assign('gameRatio', $gameRatio);
+ $this->assign('lastRatio', $lastRatio);
}
$this->assign('gameList', getAllGameList());
@@ -245,20 +253,51 @@ class PromoteGameRatioController extends ThinkController
return $reviewRule;
}
- public function getGameRatio()
+ public function getPromoteGameRatio()
{
+ $promoteId = I('post.promote_id', 0);
+ $promoteId = intval($promoteId);
$gameId = I('post.game_id', 0);
$gameId = intval($gameId);
- $gameRatio = '';
+ $record['last_ratio'] = '';
+ $status = 0;
+ if ($promoteId || $gameId) {
+ if ($promoteId && $gameId) {
+ $map['promote_id'] = $promoteId;
+ $map['game_id'] = $gameId;
+ $record = D(self::MODEL_NAME)->where($map)->find();
+ if ($record) {
+ $status = 2;
+ $record['begin_time'] = date('Y-m-d', $record['begin_time']);
+ $record['end_time'] = empty($record['end_time']) ? '' : date('Y-m-d', $record['end_time']);
+ if ($record['last_ratio_status'] == 0) {
+ $record['last_ratio'] = $this->getGameRatio($gameId);
+ }
+ } else {
+ $status = 1;
+ $record['last_ratio'] = $this->getGameRatio($gameId);
+ }
+ } elseif ($gameId) {
+ $status = 1;
+ $record['last_ratio'] = $this->getGameRatio($gameId);
+ }
+ }
+ $data = [
+ 'status' => $status,
+ 'record' => $record,
+ ];
+ $this->ajaxReturn($data);
+ }
+
+ public function getGameRatio($gameId)
+ {
+ $gameId = intval($gameId);
+ $gameRatio = '0.00';
if ($gameId) {
$map['id'] = $gameId;
$gameRatio = M('game', 'tab_')->where($map)->getField('ratio');
$gameRatio = ($gameRatio ?? '0.00') . '%';
}
- $data = [
- 'status' => 1,
- 'ratio' => $gameRatio,
- ];
- $this->ajaxReturn($data);
+ return $gameRatio;
}
}
\ No newline at end of file
diff --git a/Application/Admin/View/PromoteGameRatio/applyRatio.html b/Application/Admin/View/PromoteGameRatio/applyRatio.html
index 069e7c047..c941573b0 100644
--- a/Application/Admin/View/PromoteGameRatio/applyRatio.html
+++ b/Application/Admin/View/PromoteGameRatio/applyRatio.html
@@ -19,6 +19,9 @@
.tabcon1711 .form_unit {
margin-left: 2px;
}
+ .tabcon1711 .mustmark {
+ margin-left:-7px;
+ }
{$meta_title}
@@ -35,7 +38,7 @@
-
+
玩家充值
- 说明:充值数据不包含当日
+ 说明:玩家角色充值统计
@@ -104,8 +104,7 @@
平台 |
游戏区服 |
角色名 |
- 等级 |
- 充值总额
+ | 充值总额
@@ -116,7 +115,7 @@
|
- 充值次数
+ | 充值次数
@@ -127,7 +126,7 @@
|
- 昨日充值
+ | 今日充值
@@ -138,7 +137,7 @@
|
- 未登录天数
+ | 未登录天数
@@ -149,7 +148,7 @@
|
- 游戏累计登录天数
+ | 游戏累计登录天数
@@ -160,7 +159,7 @@
|
- 注册时间
+ | 注册时间
@@ -171,7 +170,7 @@
|
- 最后登录时间 |
+ 最后登录时间 |
推广员账号 |
@@ -183,15 +182,14 @@
{$record.game_name} |
{$record.sdk_version} |
{$record.server_name} |
- {$record.role_name} |
- {$record.role_level} |
+ {$record.game_player_name} |
{$record.recharge_cost} |
{$record.recharge_count} |
{$record.recharge_cost_today} |
{$record.unlogin_day} |
{$record.user_game_login_count} |
- {$record.create_time} |
- {$record.play_time} |
+ {$record.register_time} |
+ {$record.login_time} |
{$record.promote_account} |
@@ -201,7 +199,6 @@
-- |
-- |
-- |
- -- |
{$total.recharge_cost} |
{$total.recharge_count} |
{$total.recharge_cost_today} |
From 7709163e03ca2d8e5d4f310a9056851530747ce6 Mon Sep 17 00:00:00 2001
From: chenxiaojun <956334972@qq.com>
Date: Fri, 20 Dec 2019 13:48:15 +0800
Subject: [PATCH 4/4] =?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>=E5=85=85=E5=80=BC?=
=?UTF-8?q?=E7=8E=A9=E5=AE=B6--=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 | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php
index f59133f0b..03ccdcd0c 100644
--- a/Application/Home/Controller/QueryController.class.php
+++ b/Application/Home/Controller/QueryController.class.php
@@ -1806,22 +1806,15 @@ class QueryController extends BaseController
$map['s.promote_id'] = $queryPromote['id'];
}
- $subMap['create_time'] = ['between', [$begTime, $endTime - 1]];
+ $having = '1 = 1';
if ($costBegin != '' || $costEnd != '') {
- $having = '';
if ($costBegin != '' && $costEnd != '') {
- $having = 'sum(recharge_cost) between ' . $costBegin . ' and ' . $costEnd;
+ $having = 'recharge_cost between ' . $costBegin . ' and ' . $costEnd;
} elseif ($costBegin != '' && $costEnd == '') {
- $having = 'sum(recharge_cost) >= ' . $costBegin;
+ $having = 'recharge_cost >= ' . $costBegin;
} elseif ($costBegin == '' && $costEnd != '') {
- $having = 'sum(recharge_cost) <= ' . $costEnd;
+ $having = 'recharge_cost <= ' . $costEnd;
}
- $subQuery = M('user_play_data_count', 'tab_')->field('role_id')
- ->where($subMap)
- ->group('game_id, server_id, role_id')
- ->having($having)
- ->buildSql();
- $map['_string'] = 's.game_player_id in(' . $subQuery . ')';
}
$orderBy = 'login_time desc';
@@ -1871,6 +1864,7 @@ class QueryController extends BaseController
->join('join tab_user as u on u.id = s.user_id')
->where($map)
->group('s.game_player_id, s.server_id, s.game_id')
+ ->having($having)
->buildSql();
$query = M()->alias('record')
->table($subQuery)