Example #1
0
 /**
  * 获取余下即将销售期号
  * @param int $deadline
  * @param int $expect_num
  */
 public function getSaleExpectList($deadline = 30, $expect_num = 120)
 {
     $expect_num = 84;
     $expect_list = array();
     $fetch_time = time();
     $fetch_platform = new self($fetch_time);
     $currentSaleExpectInfo = $fetch_platform->getCurrentSaleExpectInfo($deadline);
     if (!$currentSaleExpectInfo['status']) {
         return array();
     }
     $expect_list[] = $currentSaleExpectInfo;
     $expect = intval(substr($currentSaleExpectInfo['expect'], -3));
     $opentime = $currentSaleExpectInfo['opentime'];
     for ($i = 1; $i < $expect_num; $i++) {
         $expect++;
         if ($expect > self::DAILY_OPEN_EXPECT_NUM) {
             $expect = 1;
             $date = date('Ymd', strtotime('+1 day', $opentime));
             $opentime = strtotime($date . ' 09:10:00');
         } else {
             $opentime = $opentime + 600;
         }
         // echo $this->formatExpect($expect, $opentime).'|'.date('Y-m-d H:i:s',$opentime).'+';
         //$expect = $this->formatExpect($expect, $opentime);
         $expect_list[] = array('status' => 1, 'expect' => $this->formatExpect($expect, $opentime), 'opentime' => $opentime);
     }
     return $expect_list;
 }