次のコードを変更して月次データを呼び出し、すべてのデータまたは特定の年のデータを呼び出すようにしてください。
//往期团购列表<br /> public function expired()<br /> {<br /> $partitions = D("Goods")->getGoodsPartitions();<br /> $this->assign("partitions",$partitions);<br /><br /> $site_name = trim($_REQUEST['site_name']);<br /> $cate_id = intval($_REQUEST['cate_id']);<br /> $name = trim($_REQUEST['name']);<br /> $status = trim($_REQUEST['status']);<br /> $city = trim($_REQUEST['city']);<br /> $end_time = intval($_REQUEST['end_time']);<br /> if(isset($partitions[$end_time]))<br /> $partition = $partitions[$end_time];<br /> else<br /> {<br /> $partition = current($partitions);<br /> $end_time = $partition['min_date'];<br /> }<br /> $this->assign("end_time",$end_time);<br /><br /> $parameter = array();<br /> $parameter['end_time'] = $end_time;<br /><br /> $is_empty = false;<br /> $where = '';<br /><br /> if(!empty($site_name))<br /> {<br /> $this->assign("site_name",$site_name);<br /> $parameter['site_name'] = $site_name;<br /> $ids = array();<br /> $site_ids = D('Site')->where("name like '%$site_name%'")->field('id')->findAll();<br /> foreach($site_ids as $site)<br /> {<br /> $ids[] = $site['id'];<br /> }<br /><br /> if(count($ids) > 0)<br /> $where .= ' and gk.site_id in ('.implode(',', $ids).')';<br /> else<br /> $is_empty = true;<br /> }<br /><br /> if(!empty($cate_id))<br /> {<br /> $this->assign("cate_id",$cate_id);<br /> $where.=" and gk.cate_id = $cate_id";<br /> $parameter['cate_id'] = $cate_id;<br /> }<br /><br /> if(!empty($city))<br /> {<br /> $this->assign("city",$city);<br /> $where.=" and gk.city = '$city'";<br /> $parameter['city'] = $city;<br /> }<br /><br /> if(!empty($name))<br /> {<br /> $name_query = clearSymbol($name);<br /> if(!empty($name_query))<br /> {<br /> $name_query = segmentToUnicode($name_query,'+');<br /> $match_sql = ' inner join '.C("DB_PREFIX").'goods_match as gm ON gm.id = gk.id ';<br /> $where.=" AND MATCH (gm.content) AGAINST ('$name_query' IN BOOLEAN MODE)";<br /> $this->assign("name",$name);<br /> $parameter['name'] = $name;<br /> }<br /> }<br /><br /> if($status != "" && $status >= 0)<br /> {<br /> $where.=" and g.status = $status";<br /> $this->assign("status",$status);<br /> $parameter['status'] = $status;<br /> }<br /> else<br /> {<br /> $this->assign("status",-1);<br /> }<br /><br /> if(!$is_empty)<br /> {<br /> $model = M();<br /> $count_str = 'SELECT count(g.id) as gcount<br /> FROM '.C("DB_PREFIX").'goods_key as gk<br /> inner join '.C("DB_PREFIX").'goods as g on g.id = gk.id '.$match_sql.<br /> "where $partition[where] $where ";<br /><br /> $count = $model->query($count_str);<br /> $count = $count[0]['gcount'];<br /><br /> $sql_str = 'SELECT g.id,g.name,g.shop_price,g.city,g.end_time,g.status,g.is_best,g.sort,g.cate_id,g.bought,g.site_name<br /> FROM '.C("DB_PREFIX").'goods_key as gk<br /> inner join '.C("DB_PREFIX").'goods as g on g.id = gk.id '.$match_sql.<br /> "where $partition[where] $where ";<br /><br /> $voList = $this->_sqlList($model, $sql_str, $count,$parameter, 'id', false);<br /> }<br /> else<br /> $voList = array();<br /><br /> L("FORBID","未审核");<br /> L("NORMAL","已审核");<br /><br /> $group_city_list = D("GroupCity")->where("status=1")->order("sort asc,id asc")->findAll();<br /> $this->assign("group_city_list",$group_city_list);<br /><br /> $goodsCates = D('GoodsCate')-> where("status=1")-> findAll();<br /> $goodsCates = D('GoodsCate')-> toFormatTree($goodsCates,array('name'));<br /> $this->assign("goodsCates",$goodsCates);<br /><br /> $this->display();<br /> }