Merge branch 'dev' of 47.111.118.107:wmtx/platform into dev

master
sunke 5 years ago
commit 1699c155e8

@ -130,6 +130,11 @@ class PromoteGameRatioController extends ThinkController
if (empty($params['begin_time'])) {
$this->error('请选择开始时间');
}
if (!empty($params['end_time'])) {
if (strtotime($params['end_time']) < strtotime($params['begin_time'])) {
$this->error('结束时间不得小于开始时间');
}
}
$save['ratio'] = $params['ratio'] ?? 0;
$save['begin_time'] = strtotime($params['begin_time']);
$save['end_time'] = $params['end_time'] ? strtotime($params['end_time']) : 0;

@ -1081,7 +1081,7 @@ function is_check_account($account){
}
//获取游戏cp比例
function getGameSelleRatio($gameId = null, $promoteId = null, $field = 'id')
function getGameSelleRatio($promoteId = null, $gameId = null, $field = 'id')
{
$promoteGameRatio = getGameSelleRatioByPromote($promoteId, $gameId);
if ($promoteGameRatio === false) {
@ -1102,8 +1102,21 @@ function getGameSelleRatioByPromote($promoteId = null, $gameId = null)
if (empty($promoteId) || empty($gameId)) {
return false;
}
$map['promote_id'] = intval($promoteId);
$map['game_id'] = intval($gameId);
$promoteId = intval($promoteId);
$gameId = intval($gameId);
$promote = M('promote', 'tab_')->find($promoteId);
if (empty($promote)) {
return false;
}
if ($promote['level'] != 1) {
$chain = explode('/', trim($promote['chain'], '/'));
$promoteId = empty($chain[0]) ? 0 : intval($chain[0]);
}
$map['promote_id'] = $promoteId;
$map['game_id'] = $gameId;
$promoteGameRatio = M('promote_game_ratio', 'tab_')->where($map)->find();
if (empty($promoteGameRatio) || $promoteGameRatio['status'] != 1) {

Loading…
Cancel
Save