修改bug

master
ELF 5 years ago
parent 5dd9df5cd5
commit c715996821

@ -40,8 +40,8 @@ class PromoteRepository {
if (isset($params['sdk_version'])) {
$map['sdk_version'] = $params['sdk_version'];
}
if (isset($params['begin_time']) && isset($params['begin_time'])) {
$map['create_time'] = ['between', [$params['begin_time'], $params['end_time']]];
if (isset($params['begin_time']) && isset($params['begin_time']) && isset($params['time_column'])) {
$map[$params['time_column']] = ['between', [$params['begin_time'], $params['end_time']]];
}
return $map;
}
@ -54,6 +54,7 @@ class PromoteRepository {
if (count($ids) == 0) {
return [];
}
$params['time_column'] = 'create_time';
$map = $this->getPublicAchievementMap($ids, $params);
$items = M('user_play_info', 'tab_')->field(['count(*) count', 'promote_id'])->where($map)->group('promote_id')->select();
$records = [];
@ -82,6 +83,8 @@ class PromoteRepository {
if (count($ids) == 0) {
return [];
}
$params['time_column'] = 'create_time';
$map = $this->getPublicAchievementMap($ids, $params);
$items = M('user_play_info', 'tab_')->field(['count(distinct user_id) count', 'promote_id'])->where($map)->group('promote_id')->select();
@ -111,6 +114,8 @@ class PromoteRepository {
if (count($ids) == 0) {
return [];
}
$params['time_column'] = 'create_time';
$map = $this->getPublicAchievementMap($ids, $params);
$subMap = $map;
@ -150,6 +155,8 @@ class PromoteRepository {
if (count($ids) == 0) {
return [];
}
$params['time_column'] = 'create_time';
$map = $this->getPublicAchievementMap($ids, $params);
$subMap = $map;
@ -189,6 +196,8 @@ class PromoteRepository {
if (count($ids) == 0) {
return [];
}
$params['time_column'] = 'create_time';
$map = $this->getPublicAchievementMap($ids, $params);
$subMap = $map;
@ -228,8 +237,9 @@ class PromoteRepository {
if (count($ids) == 0) {
return [];
}
$params['time_column'] = 'login_time';
$map = $this->getPublicAchievementMap($ids, $params);
$items = M('user', 'tab_')->field(['count(*) count', 'promote_id'])->where($map)->group('promote_id')->select();
$items = M('user_login_record', 'tab_')->field(['count(DISTINCT user_id) as count', 'promote_id'])->where($map)->group('promote_id')->select();
$records = [];
foreach ($items as $item) {
@ -257,6 +267,8 @@ class PromoteRepository {
if (count($ids) == 0) {
return [];
}
$params['time_column'] = 'pay_time';
$map = $this->getPublicAchievementMap($ids, $params);
$items = M('spend', 'tab_')->field(['count(*) count', 'promote_id'])->where($map)->group('promote_id')->select();
@ -287,6 +299,8 @@ class PromoteRepository {
if (count($ids) == 0) {
return [];
}
$params['time_column'] = 'pay_time';
$map = $this->getPublicAchievementMap($ids, $params);
$items = M('spend', 'tab_')->field(['count(distinct user_id) count', 'promote_id'])->where($map)->group('promote_id')->select();
@ -316,6 +330,8 @@ class PromoteRepository {
if (count($ids) == 0) {
return [];
}
$params['time_column'] = 'pay_time';
$map = $this->getPublicAchievementMap($ids, $params);
$items = M('spend', 'tab_')->field(['sum(pay_amount) amount', 'promote_id', 'pay_way'])->where($map)->group('promote_id, pay_way')->select();
$records = [];

@ -0,0 +1,45 @@
<?php
namespace Base\Service;
use Base\Model\PromoteModel;
use Base\Model\ApplyModel;
class GameSourceService {
public function __construct()
{
}
public function getChannelConfigFile($gameSource) {
$configUrl = '';
if ($gameSource['sdk_version'] == 1) {
$configUrl = "META-INF/mch.properties";
} else {
$preUrl = '';
$zipGameSource = zip_open($this->getGameSourceUrl($gameSource));
if ($zipGameSource) {
while ($zipEntry = zip_read($zipGameSource)) {
if (preg_match("/^Payload.*?\.app/", zip_entry_name($zipEntry), $matches)) {
$preUrl = $matches[0];
break;
}
}
zip_close($zipGameSource);
}
$configUrl = $preUrl . '/_CodeSignature/TXChannel';
}
return $configUrl;
}
public function getGameSourceUrl($gameSource){
$path = '';
if($gameSource['file_type'] == '1'){
$path = './Uploads/SourcePack/';
}else{
$path = './Uploads/Ios/original/';
}
$fileUrl = $path . $gameSource['file_name'];
return ROOTTT . ltrim($fileUrl, './');
}
}

@ -2804,3 +2804,12 @@ function sendBrushMail($to,$content) {
$mail->AltBody = $c; //邮件正文不支持HTML的备用显示
return($mail->Send());
}
function index_by_column($column, $items)
{
$records = [];
foreach ($items as $item) {
$records[$item[$column]] = $item;
}
return $records;
}

@ -172,7 +172,7 @@ class BaseController extends HomeController{
'p' => $page,
'row' => $pageSize
];
$pagination = set_pagination($count, $pageSize);
$pagination = set_pagination($count, $pageSize, $_POST);
return [$records, $pagination, $count];
}

@ -652,10 +652,10 @@ class QueryController extends BaseController
{
$this->meta_title = 'ARPU统计';
$defaultTime = date('Y-m-d', time() - 7 * 24 * 3600) . ' 至 ' . date('Y-m-d');
$defaultTime = date('Y-m-d', time() - 7 * 24 * 3600) . ' 至 ' . date('Y-m-d');
$defaultTime = date('Y-m-d', time() - 6 * 24 * 3600) . ' 至 ' . date('Y-m-d');
$time = I('time', $defaultTime);
$time = I('time', '');
$time = $time == '' ? $defaultTime : $time;
$sdkVersion = I('sdk_version', 0);
$gameId = I('game_id', 0);
$serverId = I('server_id', 0);
@ -672,11 +672,15 @@ class QueryController extends BaseController
$games = $this->getGamesByPromote($promote);
$params = [];
$searchGameName = '';
$searchServerName = '';
if ($gameId > 0) {
$params['game_id'] = $gameId;
$searchGameName = M('game', 'tab_')->where(['id' => $gameId])->getField('game_name');
}
if ($serverId > 0) {
$params['server_id'] = $serverId;
$searchServerName = M('server', 'tab_')->where(['server_id' => $serverId])->getField('server_name');
}
if ($sdkVersion > 0) {
$params['sdk_version'] = $sdkVersion;
@ -727,9 +731,19 @@ class QueryController extends BaseController
$this->assign('subPromotes', $subPromotes);
$this->assign('timeout', $timeout);
$this->assign('records', $records);
$this->assign('searchGameName', $searchGameName);
$this->assign('searchServerName', $searchServerName);
$this->display();
}
public function gameArpu()
{
$time = I('time');
$data = M('Apply', 'tab_')->field('game_id, game_name')->where(['promote_id' => $promote_id])->order('game_id desc')->select();
}
public function arpu_analysis()
{
$this->meta_title = "ARPU统计";
@ -1730,6 +1744,13 @@ class QueryController extends BaseController
'parent_id' => $promote['id'],
'grand_id' => $promote['id'],
];
if ($headmanPromoteId > 0) {
$map['parent_id'] = $headmanPromoteId;
}
if ($promoteId > 0) {
$map['id'] = $promoteId;
}
$ids = M('promote', 'tab_')->where($map)->getField('id', true);
$promotes = [];
@ -1751,7 +1772,7 @@ class QueryController extends BaseController
$map['role_name'] = ['like', '%' . $roleName . '%'];
}
if ($userAccount != '') {
$map['user_acount'] = ['like', '%' . $userAccount . '%'];
$map['user_account'] = ['like', '%' . $userAccount . '%'];
}
if ($sdkVersion != 0) {
$map['sdk_version'] = $sdkVersion;
@ -1778,7 +1799,6 @@ class QueryController extends BaseController
}
if ($isSelf) {
$map['promote_id'] = $promote['id'];
} else {
if ($headmanPromoteId != 0) {
$map['promote_id'] = $headmanPromoteId;
}
@ -1818,6 +1838,12 @@ class QueryController extends BaseController
'parent_id' => $promote['id'],
'grand_id' => $promote['id'],
];
if ($headmanPromoteId > 0) {
$map['parent_id'] = $headmanPromoteId;
}
if ($promoteId > 0) {
$map['id'] = $promoteId;
}
$ids = M('promote', 'tab_')->where($map)->getField('id', true);
$promotes = [];
@ -1837,7 +1863,7 @@ class QueryController extends BaseController
$map['role_name'] = ['like', '%' . $roleName . '%'];
}
if ($userAccount != '') {
$map['user_acount'] = ['like', '%' . $userAccount . '%'];
$map['user_account'] = ['like', '%' . $userAccount . '%'];
}
if ($sdkVersion != 0) {
$map['sdk_version'] = $sdkVersion;
@ -1845,11 +1871,12 @@ class QueryController extends BaseController
if ($isSelf) {
$map['promote_id'] = $promote['id'];
$spendMap['promote_id'] = $promote['id'];
} else {
if ($headmanPromoteId != 0) {
$map['promote_id'] = $headmanPromoteId;
$spendMap['promote_id'] = $headmanPromoteId;
}
if ($promoteId != 0) {
$map['promote_id'] = $promoteId;
$spendMap['promote_id'] = $promoteId;
@ -2009,6 +2036,7 @@ class QueryController extends BaseController
$gameId = I('game_id', 0);
$serverId = I('server_id', 0);
$parentId = I('parent_id', 0);
$promoteId = I('promote_id', 0);
$loginPromote = $this->getLoginPromote();
@ -2023,7 +2051,12 @@ class QueryController extends BaseController
$subPromotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $promote['id']])->select();
$query = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $promote['id']]);
$map = ['parent_id' => $promote['id']];
if ($promoteId > 0) {
$map['id'] = $promoteId;
}
$query = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where($map);
list($promotes, $pagination, $count) = $this->paginate($query);
$ids = array_column($promotes, 'id');

@ -23,7 +23,8 @@
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix">
<form action="{:U('Query/achievement',array('row'=>I('get.row')))}" method="post" enctype="multipart/form-data">
<form action="{:U('Query/achievement',['row'=>I('get.row')])}" method="post" enctype="multipart/form-data">
<input type="hidden" name="parent_id" value="{:I('parent_id', 0)}">
<div class="form-group normal_space">
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>

@ -189,7 +189,7 @@
<th>付费率</th>
<th>新增付费额</th>
<th>累计付费用户</th>
<th>1日留存</th>
<!-- <th>1日留存</th> -->
<th>ARPU</th>
<th>ARPPU</th>
<if condition='empty(I("game_id")) == true'>
@ -203,7 +203,7 @@
<tr name="rows" class="<eq name='mod' value='1'>odd</eq>">
<td>{$vo.day}</td>
<if condition='empty(I("game_id")) != true'>
<th>{:I("game_name")}</th>
<th>{$searchGameName}</th>
<else/>
<td>{$vo.payGameCount}</th>
</if>
@ -218,7 +218,7 @@
<td>{$vo.payRate}</td>
<td>{$vo.newPayAmount}</td>
<td>{$vo.historyPayCount}</td>
<td>{$vo.ratentionOneDay}</td>
<!-- <td>{$vo.ratentionOneDay}</td> -->
<td>{$vo.arpu}</td>
<td>{$vo.arppu}</td>
<if condition='empty(I("game_id")) == true'>

Loading…
Cancel
Save