/** * 获取竞价推广的排名 * * @param $propId * @param $commId * @param $smallPrice * @param $bigPrice * @param $hpratio * @param int $limit * @return int */ public static function getHouseBidRank($propId, $commId, $smallPrice, $bigPrice, $hpratio, $limit = 10) { $bidList = Model_Plan_EsfAjkPropSpread::getSpreadPlanForRank($commId, $smallPrice, $bigPrice, $hpratio, $limit); if (empty($bidList)) { return 1; } $rank = 0; foreach ($bidList as $bid) { $rank++; if ($bid['propId'] == $propId) { return $rank; } } $total = count($bidList); if ($total > $limit) { return $limit + 1; //10名以外的 } return $total + 1; }