diff --git a/Application/Admin/Controller/GiftbagController.class.php b/Application/Admin/Controller/GiftbagController.class.php
index f1b4a4dd2..47842dc2f 100644
--- a/Application/Admin/Controller/GiftbagController.class.php
+++ b/Application/Admin/Controller/GiftbagController.class.php
@@ -160,6 +160,13 @@ class GiftbagController extends ThinkController {
$model || $this->error('模型不存在!');
if(IS_POST){
+
+ if ($_POST['giftbag_version'] == '3') {
+
+ $_POST['start_time'] = time();
+
+ }
+
$Model = D(parse_name(get_table_name($model['id']),1));
// 获取模型的字段信息
@@ -174,6 +181,11 @@ class GiftbagController extends ThinkController {
}
}
$data = $Model->create();
+
+ if ($_POST['giftbag_version'] == '3') {
+ $data['start_time'] = time();
+ }
+
if($data){
$data['novice'] = str_replace(array("\r\n", "\r", "\n"), ",", $_POST['novice']);
$data['novice_num'] = count(explode(',',$data['novice']));
diff --git a/Application/Admin/View/Giftbag/add.html b/Application/Admin/View/Giftbag/add.html
index e74c544ee..ba05b766f 100644
--- a/Application/Admin/View/Giftbag/add.html
+++ b/Application/Admin/View/Giftbag/add.html
@@ -77,7 +77,7 @@
@@ -88,7 +88,7 @@
diff --git a/Application/Admin/View/Giftbag/edit.html b/Application/Admin/View/Giftbag/edit.html
index 077d46c17..27c924717 100644
--- a/Application/Admin/View/Giftbag/edit.html
+++ b/Application/Admin/View/Giftbag/edit.html
@@ -76,38 +76,48 @@
激活码: |
diff --git a/Application/Admin/View/Giftbag/lists.html b/Application/Admin/View/Giftbag/lists.html
index d7b99f137..5f0476e1d 100644
--- a/Application/Admin/View/Giftbag/lists.html
+++ b/Application/Admin/View/Giftbag/lists.html
@@ -144,7 +144,7 @@
| |
{$data.game_name} |
{$data.giftbag_name} |
- {:get_systems_name($data['giftbag_version'])} |
+ {:get_systems_name($data['giftbag_version'])}超级签全部 |
{$data['novice_num']} |
{$data['novice']} |
diff --git a/Application/Base/Repository/SpendRepository.class.php b/Application/Base/Repository/SpendRepository.class.php
index c7409113e..5b9431ab6 100644
--- a/Application/Base/Repository/SpendRepository.class.php
+++ b/Application/Base/Repository/SpendRepository.class.php
@@ -71,18 +71,6 @@ class SpendRepository {
return $this->assembleRecords($items, $dayList, 'count');
}
- /**
- * 付费游戏数
- */
- public function getPayGameCountGroupByGame($params)
- {
- $gameIds = $params['game_ids'] ?? [];
- $conditions = $this->getGameGroupConditions($params);
- $field = 'game_id, count(*) count';
- $items = M('spend', 'tab_')->field($field)->where($conditions)->group('game_id')->select();
- return $this->assembleRecords($items, $gameIds, 'count', 'game_id');
- }
-
/**
* 按天统计付款总额
*/
@@ -124,7 +112,7 @@ class SpendRepository {
$conditions = $this->getGameGroupConditions($params);
$field = 'game_id, count(distinct user_id) count';
$items = M('spend', 'tab_')->field($field)->where($conditions)->group('game_id')->select();
- return $this->assembleRecords($items, $dayList, 'count', 'game_id');
+ return $this->assembleRecords($items, $gameIds, 'count', 'game_id');
}
/**
diff --git a/Application/Base/Repository/UserRepository.class.php b/Application/Base/Repository/UserRepository.class.php
index 696379bb5..0f58c6834 100644
--- a/Application/Base/Repository/UserRepository.class.php
+++ b/Application/Base/Repository/UserRepository.class.php
@@ -112,11 +112,11 @@ class UserRepository {
$params['time_column'] = 'register_time';
$conditions = $this->getGameGroupConditions($params);
- $items = M('user', 'tab_')->field('count(*) count, game_id')
+ $items = M('user', 'tab_')->field('count(*) count, fgame_id')
->where($conditions)
- ->group('game_id')
+ ->group('fgame_id')
->select();
- return $this->assembleRecords($items, $gameIds, 'count', 'game_id');
+ return $this->assembleRecords($items, $gameIds, 'count', 'fgame_id');
}
/**
diff --git a/Application/Callback/Controller/NotifyController.class.php b/Application/Callback/Controller/NotifyController.class.php
index 3f6688633..4b5af2e66 100644
--- a/Application/Callback/Controller/NotifyController.class.php
+++ b/Application/Callback/Controller/NotifyController.class.php
@@ -67,7 +67,7 @@ class NotifyController extends BaseController
Log::write(serialize($order_info), Log::DEBUG);
if ($order_info['status']) {
$pay_where = substr($order_info['out_trade_no'], 0, 2);
-
+ Log::write("PAY_SWI:".$pay_where, Log::DEBUG);
$result = false;
switch ($pay_where) {
diff --git a/Application/Home/Controller/ApplyController.class.php b/Application/Home/Controller/ApplyController.class.php
index 00e47117e..9a03ac1e0 100644
--- a/Application/Home/Controller/ApplyController.class.php
+++ b/Application/Home/Controller/ApplyController.class.php
@@ -196,8 +196,8 @@ class ApplyController extends BaseController
$this->meta_title = "申请游戏";
$this->display('index');
}
-
- //查看游戏资料专区
+
+ //查看游戏资料专区
public function feature($p = 0, $type = 0)
{
$promoteId = empty(I('promote_id')) ? PID : I('promote_id');//搜索的渠道ID
@@ -214,21 +214,21 @@ class ApplyController extends BaseController
$map['tab_game.down_port'] = 1;//游戏端口 第三方接口不能申请
$map['tab_game.game_status'] = 1;//游戏状态
$map['tab_game.developers'] = 0; //平台游戏(官网游戏,非开发者游戏)
-
- $applyPromote = M('apply','tab_')->field('game_id')->where(['promote_id' => $promoteId])->select();
- $noDeveloperGameArr = array();
-
- foreach ($applyPromote as $key => $value) {
- $applyPromoteGameId = $value['game_id'];
- $gameInfo = M('Game','tab_')
- ->field('id,icon,game_name,features,sdk_version,game_size,game_type_name,relation_game_name,developers')
- ->where(['id' => $applyPromoteGameId])->select();
- if($gameInfo[0]['developers'] > 0){
- unset($gameInfo[0]['developers']);
- $noDeveloperGameArr[] = $gameInfo[0]['id'] ; //非开发者游戏
- }
- }
-
+
+ $applyPromote = M('apply', 'tab_')->field('game_id')->where(['promote_id' => $promoteId])->select();
+ $noDeveloperGameArr = array();
+
+ foreach ($applyPromote as $key => $value) {
+ $applyPromoteGameId = $value['game_id'];
+ $gameInfo = M('Game', 'tab_')
+ ->field('id,icon,game_name,features,sdk_version,game_size,game_type_name,relation_game_name,developers')
+ ->where(['id' => $applyPromoteGameId])->select();
+ if ($gameInfo[0]['developers'] > 0) {
+ unset($gameInfo[0]['developers']);
+ $noDeveloperGameArr[] = $gameInfo[0]['id']; //非开发者游戏
+ }
+ }
+
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
@@ -244,9 +244,9 @@ class ApplyController extends BaseController
$map['tab_game.relation_game_name'] = ['like', $thisRelationGameName];
$where['_complex'] = $map;
- // $where['tab_game.id'] = ['in',$noDeveloperGameArr];
- // $where['_logic']='or';
- }else {
+ // $where['tab_game.id'] = ['in',$noDeveloperGameArr];
+ // $where['_logic']='or';
+ } else {
$where['_complex'] = $map;
if(empty($noDeveloperGameArr)) {
$where['tab_game.id'] = ['in','-100'];
@@ -256,7 +256,7 @@ class ApplyController extends BaseController
$where['_logic']='or';
}
-
+
$data = M('Game', 'tab_')
->field('tab_game.id,tab_game.icon,tab_game.game_name,tab_game.features,tab_game.sdk_version,tab_game.game_size,tab_game.game_type_name,tab_game.relation_game_name,ta_1.id as apply_id_1')
->join('left join tab_apply as ta_1 on tab_game.id = ta_1.game_id and ta_1.offline_status = 0 and ta_1.promote_id = ' . $promoteId)//查询是否拥有该游戏
@@ -265,7 +265,7 @@ class ApplyController extends BaseController
->page($page, $row)
->select();
//$AllData = array_merge($noDeveloperGameArr,$data);
-
+
/* 查询记录总数 */
$count = M("Game", "tab_")
->field('tab_game.id')
@@ -288,13 +288,13 @@ class ApplyController extends BaseController
$this->assign('list_data', $data);
$this->assign("count", $count);
$this->assign("promoteId", $promoteId);
- // $this->assign('parentPromoteId', $parentPromoteId);
+ // $this->assign('parentPromoteId', $parentPromoteId);
$this->assign('thisParentPromoteId', $thisParentPromoteId);
- // $this->assign('promoteRole', $promoteRole);
+ // $this->assign('promoteRole', $promoteRole);
$this->assign('pID', PID);
//$this->assign('promoteData', getAllPromoteListByType($promoteRole));
// $this->assign('addPermission', $addPermission);
- // $this->assign('type', $type);
+ // $this->assign('type', $type);
$this->meta_title = "申请游戏";
@@ -1731,25 +1731,26 @@ class ApplyController extends BaseController
$this->ajaxReturn(['status' => 1, 'data' => $enableStatus]);
}
-
- public function backDetailData() { //返回详情数据
- $result = ['code' => 10001,'msg' => "该游戏信息不存在,请确认!",'error' => 1,'info' => ''];
+
+ public function backDetailData()
+ { //返回详情数据
+ $result = ['code' => 10001, 'msg' => "该游戏信息不存在,请确认!", 'error' => 1, 'info' => ''];
$id = $_POST['id'];
- if(empty($id)) {
+ if (empty($id)) {
$this->ajaxReturn($result);
}
- $gameInfo = M('Game','tab_')->where(['id' => $id])->getField('detail_content');
- if(!$gameInfo) {
- $this->ajaxReturn($result);
- }else {
+ $gameInfo = M('Game', 'tab_')->where(['id' => $id])->getField('detail_content');
+ if (!$gameInfo) {
+ $this->ajaxReturn($result);
+ } else {
$result['code'] = 10000;
$result['msg'] = "获取信息成功";
$result['error'] = -1;
$result['info'] = $gameInfo;
$this->ajaxReturn($result);
-
+
}
-
-
+
+
}
}
diff --git a/Application/Home/Controller/HomeController.class.php b/Application/Home/Controller/HomeController.class.php
index 700548de0..f8b481a16 100644
--- a/Application/Home/Controller/HomeController.class.php
+++ b/Application/Home/Controller/HomeController.class.php
@@ -117,15 +117,19 @@ class HomeController extends Controller
{
$gameData = M('Game', 'tab_')
->field('relation_game_id,sdk_version')
- ->where(array('id' => $_GET['gid']))
+ ->where(array('id' => intval($_GET['gid'])))
->find();
$RelationGameId = $gameData['relation_game_id'];
$gameSdkType = $gameData['sdk_version'];
$map['tab_game.relation_game_id'] = $RelationGameId;
- $map['ta.promote_id'] = $_GET['pid'];
- $data = M('game', 'tab_')->field('tab_game.id,tab_game.sdk_version,tab_game.icon,tab_game.screenshot,tab_game.relation_game_id,tab_game.relation_game_name,ta.enable_status,tab_game.dow_status,tab_game.features,tab_game.flooring_page_imgs')->where($map)->join('tab_apply ta ON ta.game_id = tab_game.id and ta.offline_status = 0 and ta.promote_id=' . $_GET['pid'])->select();
+ $data = M('game', 'tab_')
+ ->field('tab_game.id,tab_game.sdk_version,tab_game.icon,tab_game.screenshot,tab_game.relation_game_id,tab_game.relation_game_name,ta.enable_status,tab_game.dow_status,tab_game.features,tab_game.flooring_page_imgs,ta.promote_id')
+ ->join('tab_apply ta ON ta.game_id = tab_game.id and ta.offline_status = 0 and ta.promote_id=' . intval($_GET['pid']))
+ ->where($map)
+ ->group('tab_game.id')
+ ->select();
foreach ($data as $key => $value) {
if (!empty($value['flooring_page_imgs'])) {
diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php
index 933295615..a805529f1 100644
--- a/Application/Home/Controller/QueryController.class.php
+++ b/Application/Home/Controller/QueryController.class.php
@@ -39,8 +39,10 @@ class QueryController extends BaseController
$childPromoteIds = getAllChildPromoteList(3);
if (empty($childPromoteIds)) {
- $map['tab_spend.promote_id'] = 0;
+ $map['tab_spend.promote_id'] = PID;
} else {
+ $childPromoteIds .= ',' . PID;
+
$map['tab_spend.promote_id'] = ['in', $childPromoteIds];
}
@@ -183,8 +185,10 @@ class QueryController extends BaseController
$childPromoteIds = getAllChildPromoteList(3);
if (empty($childPromoteIds)) {
- $map['tab_user.promote_id'] = 0;
+ $map['tab_user.promote_id'] = PID;
} else {
+ $childPromoteIds .= ',' . PID;
+
$map['tab_user.promote_id'] = ['in', $childPromoteIds];
}
@@ -760,6 +764,7 @@ class QueryController extends BaseController
$time = I('time', date('Y-m-d'));
$applys = M('Apply', 'tab_')->field('game_id, game_name')->where(['promote_id' => $promote['id']])->order('game_id desc')->select();
$gameIds = array_column($applys, 'game_id');
+ $applys = index_by_column('game_id', $applys);
$params = [
'begin_time' => strtotime($time . ' 00:00:00'),
@@ -768,10 +773,36 @@ class QueryController extends BaseController
'promote_ids' => $ids,
];
+ $userRepository = new UserRepository();
$spendRepository = new SpendRepository();
- // $result = $spendRepository->getHistoryPayCountGroupByGame($params);
- $result = $spendRepository->getPayGameCountGroupByGame($params);
- var_dump($result);
+ $payUserCountList = $spendRepository->getPayUserCountGroupByGame($params);
+ $newPayUserCountList = $spendRepository->getNewPayUserCountGroupByGame($params);
+ $payAmountList = $spendRepository->getPayAmountGroupByGame($params);
+ $newPayAmountList = $spendRepository->getNewPayAmountGroupByGame($params);
+ $historyPayCountList = $spendRepository->getHistoryPayCountGroupByGame($params);
+ $loginCountList = $userRepository->getLoginCountGroupByGame($params);
+ $registerCountList = $userRepository->getRegisterCountGroupByGame($params);
+
+ foreach ($gameIds as $gameId) {
+ $records[] = [
+ 'gameId' => $gameId,
+ 'gameName' => $applys[$gameId]['game_name'],
+ 'payUserCount' => $payUserCountList[$gameId],
+ 'newPayUserCount' => $newPayUserCountList[$gameId],
+ 'payAmount' => number_format($payAmountList[$gameId], 2),
+ 'newPayAmount' => number_format($newPayAmountList[$gameId], 2),
+ 'historyPayCount' => $historyPayCountList[$gameId],
+ 'loginCount' => $loginCountList[$gameId],
+ 'registerCount' => $registerCountList[$gameId],
+ 'payRate' => $loginCountList[$gameId] == 0 ? '--' : round($payUserCountList[$gameId] / $loginCountList[$gameId] * 100, 2) . '%',
+ 'ratentionOneDay' => '--',
+ 'arpu' => $loginCountList[$gameId] == 0 ? '0.00' : number_format(round($payAmountList[$gameId] / $loginCountList[$gameId], 2), 2),
+ 'arppu' => $payUserCountList[$gameId] == 0 ? '0.00' : number_format(round($payAmountList[$gameId] / $payUserCountList[$gameId], 2), 2),
+ ];
+ }
+
+ $this->assign('records', $records);
+ $this->display('gameArpu');
}
public function arpu_analysis()
@@ -994,10 +1025,12 @@ class QueryController extends BaseController
{
$childPromoteIds = getAllChildPromoteList(3);
if (empty($childPromoteIds)) {
- $userPlayInfoWhere['tab_user_play_info.promote_id'] = 0;
- $userGameLoginWhere['tab_user_game_login_record.promote_id'] = 0;
- $spendWhere['tab_spend.promote_id'] = 0;
+ $userPlayInfoWhere['tab_user_play_info.promote_id'] = PID;
+ $userGameLoginWhere['tab_user_game_login_record.promote_id'] = PID;
+ $spendWhere['tab_spend.promote_id'] = PID;
} else {
+ $childPromoteIds .= ',' . PID;
+
$userPlayInfoWhere['tab_user_play_info.promote_id'] = ['in', $childPromoteIds];
$userGameLoginWhere['tab_user_game_login_record.promote_id'] = ['in', $childPromoteIds];
$spendWhere['tab_spend.promote_id'] = ['in', $childPromoteIds];
@@ -1243,11 +1276,13 @@ class QueryController extends BaseController
$childPromoteIds = getAllChildPromoteList(3);
if (empty($childPromoteIds)) {
- $map['tab_apply.promote_id'] = 0;
- $userPlayInfoMap['tab_user_play_info.promote_id'] = 0;
- $userGameLoginMap['tab_user_game_login_record.promote_id'] = 0;
- $spendMap['tab_spend.promote_id'] = 0;
+ $map['tab_apply.promote_id'] = PID;
+ $userPlayInfoMap['tab_user_play_info.promote_id'] = PID;
+ $userGameLoginMap['tab_user_game_login_record.promote_id'] = PID;
+ $spendMap['tab_spend.promote_id'] = PID;
} else {
+ $childPromoteIds .= ',' . PID;
+
$map['tab_apply.promote_id'] = ['in', $childPromoteIds];
$userPlayInfoMap['tab_user_play_info.promote_id'] = ['in', $childPromoteIds];
$userGameLoginMap['tab_user_game_login_record.promote_id'] = ['in', $childPromoteIds];
@@ -1929,7 +1964,7 @@ class QueryController extends BaseController
} else {
$spendMap['_string'] = '1<>1';
}
- $allRecharges = M('spend', 'tab_')->field('count(*) count, sum(cost) cost, game_player_id')->where($gameMap)->group('game_player_id')->select();
+ $allRecharges = M('spend', 'tab_')->field('count(*) count, sum(cost) cost, game_player_id')->where($spendMap)->group('game_player_id')->select();
$allRecords = [];
foreach ($allRecharges as $recharge) {
$allRecords[$recharge['game_player_id']] = $recharge;
diff --git a/Application/Home/Controller/TestResourceController.class.php b/Application/Home/Controller/TestResourceController.class.php
index d20157bf8..55be6005b 100644
--- a/Application/Home/Controller/TestResourceController.class.php
+++ b/Application/Home/Controller/TestResourceController.class.php
@@ -200,9 +200,14 @@ class TestResourceController extends BaseController
$arrUserId = array_column($data,'id');
$logId = implode(',',$arrUserId);
- $logRead = M('protect_log_read','tab_')
- ->where("log_id IN({$logId}) and promote_id = {$promote_id}")
- ->select();
+ if ($logId) {
+ $logRead = M('protect_log_read','tab_')
+ ->where("log_id IN({$logId}) and promote_id = {$promote_id}")
+ ->select();
+ }
+ else {
+ $logRead = [];
+ }
$upsetData = array_column($logRead,'log_id');
diff --git a/Application/Home/View/default/Query/arpu.html b/Application/Home/View/default/Query/arpu.html
index 0ec23603b..f5d6c5108 100644
--- a/Application/Home/View/default/Query/arpu.html
+++ b/Application/Home/View/default/Query/arpu.html
@@ -223,7 +223,7 @@
| {$vo.arppu} |
- 查看
+ 查看
|
@@ -325,7 +325,7 @@ var gameId = $('#game-select').val();
function chakan(key) {
var bangbi = $('#bangbi').val();
var promote_id = $('#promote_arpu').val();
- url = "/index.php?s=/Home/Query/cha_userarpu/time/"+key+"/bangbi/"+bangbi+"/promote_id/"+promote_id;
+ url = "/index.php?s=/Home/Query/gameArpu/time/"+key+"/bangbi/"+bangbi+"/promote_id/"+promote_id;
timetitle = key;
console.log(url);
layer.open({
diff --git a/Application/Home/View/default/Query/dailySummary.html b/Application/Home/View/default/Query/dailySummary.html
index 54ff2d148..dc95c9507 100644
--- a/Application/Home/View/default/Query/dailySummary.html
+++ b/Application/Home/View/default/Query/dailySummary.html
@@ -463,7 +463,10 @@
dataType: 'json',
success: function (data) {
var html = "