示例#1
0
 /**
  * @param $spreadId
  * @param int $commId
  * @param int $smallPrice
  * @param int $bigPrice
  * @return int|string
  */
 public function getPpcSaleRankBll($propId = 0, $commId = 0, $smallPrice = 0, $bigPrice = 0, $hpratio = 0, $limit = 10)
 {
     $rstRank = Model_Plan_EsfAjkPropSpread::getPpcSaleRankDao($commId, $smallPrice, $bigPrice, $hpratio, $limit);
     $rank = 0;
     if (isset($rstRank) && !empty($rstRank)) {
         foreach ($rstRank as $key => $val) {
             $rank = $key + 1;
             if ($val->propId == $propId) {
                 return $rank;
             }
         }
         $total = count($rstRank);
         if ($total > $limit) {
             return $limit + 1;
             //10名以外的
         } else {
             return $total + 1;
         }
     } else {
         return 1;
     }
 }