Esempio n. 1
0
 /**
  * 更新坑位信息,重新计算
  *
  * @param int $blockId
  * @param int $priceId
  * @return bool
  */
 private static function updateBucket($blockId, $priceId)
 {
     $bucketCount = Bll_HzBidPlan::countBucketChoicePlan($blockId, $priceId);
     $bucketInfo = Bll_Choice_HzBidBucket::getBucketInfo($blockId, $priceId);
     if (empty($bucketInfo)) {
         $bucketInfo = Bll_Choice_HzBidBucket::init_bucket_info($blockId, $priceId);
     }
     if ($bucketInfo['usedNum'] == $bucketCount) {
         return true;
     }
     $condition = array('blockId' => $blockId, 'priceId' => $priceId);
     return 1 == Model_Choice_HzBidBucket::updateBucket($condition, array('usedNum' => min($bucketCount, $bucketInfo['totalNum'])));
 }