diff --git a/Application/Common/Common/extend.php b/Application/Common/Common/extend.php index 8d9b15e40..476064d0d 100644 --- a/Application/Common/Common/extend.php +++ b/Application/Common/Common/extend.php @@ -1102,15 +1102,17 @@ function getGameSelleRatioByPromote($promoteId = null, $gameId = null) if (empty($promoteId) || empty($gameId)) { return false; } + $promoteId = intval($promoteId); $gameId = intval($gameId); $promote = M('promote', 'tab_')->find($promoteId); + if (empty($promote)) { return false; } if ($promote['level'] != 1) { - $promoteId = explode('/', trim($promote['chain'], '/'))[0]; - $promoteId = intval($promoteId); + $chain = explode('/', trim($promote['chain'], '/')); + $promoteId = empty($chain[0]) ? 0 : intval($chain[0]); } $map['promote_id'] = $promoteId;