Ejemplo n.º 1
0
 public function __construct()
 {
     parent::__construct();
     import('function.datehelper');
     $model_stat = Model('stat');
     $this->search_arr = $_POST;
     //$this->search_arr = $_GET;
     //处理搜索时间
     if ($this->search_arr['stattype'] == 'yesterday') {
         $this->search_arr['search_type'] = 'day';
         $this->search_arr['show_type'] = 'hour';
         $this->search_arr['day']['search_time'] = date('Y-m-d', time() - 86400);
         $this->search_arr['day']['search_time'] = strtotime($this->search_arr['day']['search_time']);
     } elseif ($this->search_arr['stattype'] == 'day3') {
         $this->search_arr['search_type'] = 'day3';
         $this->search_arr['show_type'] = 'day';
         $this->search_arr['day']['search_time'] = date('Y-m-d', time() - 86400);
         $this->search_arr['day']['search_time'] = strtotime($this->search_arr['day']['search_time']);
     } elseif ($this->search_arr['stattype'] == 'day7') {
         $this->search_arr['search_type'] = 'day7';
         $this->search_arr['show_type'] = 'day';
         $this->search_arr['day']['search_time'] = date('Y-m-d', time() - 86400);
         $this->search_arr['day']['search_time'] = strtotime($this->search_arr['day']['search_time']);
     } elseif ($this->search_arr['stattype'] == 'week') {
         $this->search_arr['search_type'] = 'week';
         $this->search_arr['show_type'] = 'week';
         $searchweek_weekarr = getWeek_SdateAndEdate(time());
         $this->search_arr['week']['current_week'] = implode('|', $searchweek_weekarr);
     } elseif ($this->search_arr['stattype'] == 'month') {
         $this->search_arr['search_type'] = 'month';
         $this->search_arr['show_type'] = 'day';
         $this->search_arr['month']['current_year'] = date('Y', time());
         $this->search_arr['month']['current_month'] = date('m', time());
     } elseif ($this->search_arr['stattype'] == 'year') {
         $this->search_arr['search_type'] = 'year';
         $this->search_arr['show_type'] = 'month';
         $this->search_arr['year']['current_year'] = date('Y', time());
     }
     $searchtime_arr = $model_stat->getStarttimeAndEndtime($this->search_arr);
     $this->search_arr['stime'] = $searchtime_arr[0];
     $this->search_arr['etime'] = $searchtime_arr[1];
 }
Ejemplo n.º 2
0
 public function __construct()
 {
     parent::__construct();
 }