diff --git a/Application/Admin/Controller/BehaviorLogController.class.php b/Application/Admin/Controller/BehaviorLogController.class.php
index 88e78162a..5720a6f55 100644
--- a/Application/Admin/Controller/BehaviorLogController.class.php
+++ b/Application/Admin/Controller/BehaviorLogController.class.php
@@ -11,25 +11,25 @@ class BehaviorLogController extends ThinkController
$map = [];
if (isset($params['user_account'])) {
- $map['tab_pay_info.user_account'] = $params['user_account'];
+ $map['user_account'] = $params['user_account'];
}
if (isset($params['extend'])) {
- $map['tab_pay_info.extend'] = $params['extend'];
+ $map['_string'] = 'extend = "'.$params["extend"]. '" or order_id = "'.$params["extend"] . '"';
}
if (isset($params['game_name'])) {
$game_id = ['in', array_column(getGameByName($params['game_name'], $params['sdk_version']), 'id')];
- $map['tab_pay_info.game_id'] = $game_id;
+ $map['game_id'] = $game_id;
}
if (isset($params['server_name'])) {
$game_id = M('game', 'tab_')->where(['relation_game_name' => $params['game_name'],'sdk_version' => $params['sdk_version']])->getField('id');
$server_id = M('server', 'tab_')->where(['server_name' => $params['server_name'], 'game_id' => $game_id])->getField('server_num');
- $map['tab_pay_info.server_id'] = $server_id;
+ $map['server_id'] = $server_id;
}
if (isset($params['game_player_name'])) {
- $map['tab_pay_info.game_player_name'] = $params['game_player_name'];
+ $map['game_player_name'] = $params['game_player_name'];
}
if (isset($params['game_player_id'])) {
- $map['tab_pay_info.game_player_id'] = $params['game_player_id'];
+ $map['game_player_id'] = $params['game_player_id'];
}
@@ -40,7 +40,7 @@ class BehaviorLogController extends ThinkController
$endDate = empty($params['timeend']) ? date('Y-m-d') : $params['timeend'];
$startTime = strtotime($startDate);
$endTime = strtotime($endDate) + 86399;
- $map['tab_pay_info.create_time'] = array('BETWEEN', [$startTime, $endTime]);
+ $map['create_time'] = array('BETWEEN', [$startTime, $endTime]);
if (isset($params['promote_id'])) {
$promoteId = $params['promote_id'];
if ($promoteId == 0) {
@@ -52,13 +52,22 @@ class BehaviorLogController extends ThinkController
$map['promote_id'] = ['in', $promoteIds];
}
}
- $data = M('pay_info', 'tab_')->field('tab_pay_info.id,tab_pay_info.user_account,extend,tab_pay_info.create_time,tab_pay_info.game_name,tab_pay_info.server_name,tab_pay_info.promote_account,tab_pay_info.order_id,tab_pay_info.game_player_id,tab_pay_info.game_player_name,price,tab_server.server_name')->join('LEFT JOIN tab_server on tab_pay_info.server_id = tab_server.server_num AND tab_pay_info.game_id = tab_server.game_id')->where($map)->order('tab_pay_info.id DESC')->page($p, $row)->select();
+ // $data = M('pay_info', 'tab_')->field('tab_pay_info.id,tab_pay_info.user_account,extend,tab_pay_info.create_time,tab_pay_info.game_name,tab_pay_info.server_name,tab_pay_info.promote_account,tab_pay_info.order_id,tab_pay_info.game_player_id,tab_pay_info.game_player_name,price,tab_server.server_name')->join('LEFT JOIN tab_server on tab_pay_info.server_id = tab_server.server_num AND tab_pay_info.game_id = tab_server.game_id AND tab_pay_info.server_id <> 0')->where($map)->order('tab_pay_info.id DESC')->page($p, $row)->select();
+ $data = M('pay_info', 'tab_')->where($map)->order('id DESC')->page($p, $row)->select();
foreach($data as $k => $v) {
if(empty($v['extend'])) {
$data[$k]['extend'] = $v['order_id'];
}
+ if ($v['server_id'] > 0 && !empty($v['extend'])){
+ $data[$k]['server_name'] = M('server', 'tab_')->where(['game_id' => $v['game_id'],'server_num' =>$v['server_id']])->getField('server_name');
+ } else {
+ $data[$k]['server_name'] = '';
+ $data[$k]['game_player_name'] = '';
+ $data[$k]['game_player_id'] = '';
+
+ }
}
- $count = M('pay_info', 'tab_')->join('tab_server on tab_pay_info.server_id = tab_server.server_num AND tab_pay_info.game_id = tab_server.game_id')->where($map)->count();
+ $count = M('pay_info', 'tab_')->where($map)->count();
$page = set_pagination($count, $row);
if ($page) {
$this->assign('_page', $page);
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} |
diff --git a/Data/update.sql b/Data/update.sql
index 3cce3a7fd..9eb3a11c3 100644
--- a/Data/update.sql
+++ b/Data/update.sql
@@ -783,6 +783,8 @@ CREATE TABLE `tab_promote_game_ratio` (
`promote_id` int(11) NOT NULL DEFAULT '0' COMMENT '推广员id',
`game_id` int(11) NOT NULL DEFAULT '0' COMMENT '游戏id',
`ratio` decimal(5,2) NOT NULL DEFAULT '0.00' COMMENT '分成比例',
+ `last_ratio` decimal(5,2) NOT NULL DEFAULT '0.00' COMMENT '上次的分成比例',
+ `last_ratio_status` tinyint(3) NOT NULL DEFAULT '0' COMMENT '上次的分成比例状态:0-未设置 1-已设置',
`begin_time` int(10) NOT NULL DEFAULT '0' COMMENT '开始时间',
`end_time` int(10) NOT NULL DEFAULT '0' COMMENT '过期时间',
`remark` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '备注',
@@ -794,7 +796,7 @@ CREATE TABLE `tab_promote_game_ratio` (
`update_time` int(10) NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `promote_id` (`promote_id`,`game_id`,`status`) USING BTREE
-) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- 超级签统计菜单
INSERT INTO `sys_menu`( `title`, `pid`, `sort`, `url`, `hide`, `tip`, `group`, `is_dev`, `status`) VALUES ('游戏统计', 137, 0, 'SuperStatistical/index', 0, '', '财务管理', 0, 1);