|
|
@ -1081,7 +1081,7 @@ function is_check_account($account){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//获取游戏cp比例
|
|
|
|
//获取游戏cp比例
|
|
|
|
function getGameSelleRatio($gameId = null, $promoteId = null, $field = 'id')
|
|
|
|
function getGameSelleRatio($promoteId = null, $gameId = null, $field = 'id')
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$promoteGameRatio = getGameSelleRatioByPromote($promoteId, $gameId);
|
|
|
|
$promoteGameRatio = getGameSelleRatioByPromote($promoteId, $gameId);
|
|
|
|
if ($promoteGameRatio === false) {
|
|
|
|
if ($promoteGameRatio === false) {
|
|
|
@ -1102,8 +1102,21 @@ function getGameSelleRatioByPromote($promoteId = null, $gameId = null)
|
|
|
|
if (empty($promoteId) || empty($gameId)) {
|
|
|
|
if (empty($promoteId) || empty($gameId)) {
|
|
|
|
return false;
|
|
|
|
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();
|
|
|
|
$promoteGameRatio = M('promote_game_ratio', 'tab_')->where($map)->find();
|
|
|
|
|
|
|
|
|
|
|
|
if (empty($promoteGameRatio) || $promoteGameRatio['status'] != 1) {
|
|
|
|
if (empty($promoteGameRatio) || $promoteGameRatio['status'] != 1) {
|
|
|
|