次のコードは 24 時間以内にデータを呼び出します。1 か月または 1 年間のデータを呼び出すように変更するにはどうすればよいですか?
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> プライベート関数 getList($where='',$no_query = false) { グローバル $_FANWE; if(!$no_query) { if(定義('IS_CACHE_TPL')) $フィールド = ''; それ以外 $fields = ',g.post_count'; $page_args = 配列( 'city_py' => CURRENT_CITY_PY, 'サイト' => intval($_FANWE['リクエスト']['サイト']), 'cat' => intval($_FANWE['request']['cat']), 'ソート' => トリム($_FANWE['リクエスト']['ソート']), '日付' => トリム($_FANWE['リクエスト']['日付']), 'キーワード' => トリム($_FANWE['リクエスト']['キーワード']), '価格' => トリム($_FANWE['リクエスト']['価格']), ); $サイトID = 0; if($page_args['サイト'] > 0) { $site_id = $page_args['サイト']; $site_where = ' AND gk.site_id = '.$page_args['site']; } それ以外 unset($page_args['サイト']); $dates = S('Goods')->getExpiredGoodsDate(); $min_time = getTodayTime(); $max_time = TIME_UTC; $date = toDate($min_time,'Y-m-d'); if(!empty($page_args['date'])) { $time = str2Time($page_args['date']); if($time = $dates['min_time']) { $date = toDate($time,'Y-m-d'); $min_time = str2Time(toDate($time,'Y-m-d')); $max_time = $min_time + 863990000; if($max_time > TIME_UTC) $max_time = TIME_UTC; } } それ以外 { $page_args['date'] = $date; } $dates['min_time'] = toDate($dates['min_time'],'r'); $dates['max_time'] = toDate($dates['max_time'],'r'); $where.=" AND gk.end_time >= '$min_time' AND gk.end_time <= '$max_time'"; $キーワード = ''; if($page_args['キーワード'] != '') { $page_args['キーワード'] = urldecode($page_args['キーワード']); $keyword = &$page_args['keyword']; $keyword_query = mysqlLikeQuote($page_args['keyword']); $where.=" AND (g.name LIKE '%$keyword_query%')"; } それ以外 unset($page_args['キーワード']); $insert_sort = 'gk.cr_sort ASC'; if($page_args['cat'] > 0) $insert_sort = 'gk.ec_sort ASC'; if(in_array($page_args['cat'],$_FANWE['cache']['goods']['root_cates'])) $insert_sort = 'gk.dc_sort ASC'; $city_name = $_FANWE['current_city']['name']; if(CURRENT_CITY_PY == 中国_CITY_PY) { //国にすべての都市産品が含まれていない場合 if($_FANWE['設定']['すべての都市'] == 0) $where.= " AND gk.city = '$city_name'"; それ以外 { $insert_sort = 'gk.r_sort ASC'; if($page_args['cat'] > 0) $insert_sort = 'gk.e_sort ASC'; if(in_array($page_args['cat'],$_FANWE['cache']['goods']['root_cates'])) $insert_sort = 'gk.d_sort ASC'; } } elseif(CURRENT_CITY_PY != '') { //都市が国産品を展示する場合 if($_FANWE['setting']['index_all'] == 1) { $fields .= ",(gk.city = '$city_name') as is_now_city"; $insert_sort = 'is_now_city DESC,'.$insert_sort; $quanguo_name = $_FANWE['キャッシュ']['都市']['すべて'][CHINA_CITY_PY]['名前']; $where.= " AND gk.city IN ('$city_name','$quanguo_name')"; } それ以外 { $where.= " AND gk.city = '$city_name'"; } }//条件 $価格 = ''; if(!empty($page_args['prices'])) { $prices = &$page_args['prices']; $price_arr =explode(',',$prices); $price_min = intval($price_arr[0]); $price_max = intval($price_arr[1]); if($price_min > 0) $where.=" AND (g.shop_price >= $price_min)"; if($price_max > 0) $where.=" AND (g.shop_price 0) { $cate_id = &$page_args['猫']; $cateobj = $_FANWE['cache']['goods']['cats'][$cate_id]; $cate_ids = 配列(); if(isset($cateobj['childs'])) $cate_ids = $cateobj['childs']; $cate_ids[] = $cate_id; if(count($cate_ids) > 1) $where.=' AND gk.cate_id IN ('.implode(',', $cate_ids).')'; それ以外 $where.=" AND gk.cate_id = '$cate_id'"; } それ以外 unset($page_args['cat']); $goods_sites = S('Goods')->getExpiredGoodsSites($where); $where = $site_where.$where; $order = ''; $sort = &$page_args['sort']; $sort_array = array('spa'=>'g.shop_price ASC','spd'=>'g.shop_price DESC','eta'=>'g.end_time ASC','etd'=> 'g.end_time DESC','cca'=>'g.click_count ASC','ccd'=>'g.click_count DESC','sa'=>'g.score ASC','sd'= >'g.スコア DESC','ba'=>'g.購入した ASC','bd'=>'g.購入した DESC','da'=>'割引 ASC','dd'= >'割引DESC'); if(array_key_exists($sort,$sort_array)) $order = $sort_array[$sort]; それ以外 { unset($page_args['sort']); $sort = ''; } if(空($order)) $order .= 'g.is_best DESC,'.$insert_sort.',g.sort ASC,g.id ASC'; それ以外 $order .= ','.$insert_sort.',g.sort ASC,g.id DESC'; $goods_count = S('Goods')->getExpiredGoodsCount($where); $pager = buildPage('goods/'.ACTION_NAME,$page_args,$goods_count,$_FANWE['page'],15); $goods_result = S('Goods')->getExpiredGoodsList($where,$order,$fields,$pager['limit']); $goods_result['ids'] = implode(',',$goods_result['ids']); } include template('page/goods_index'); } <div class="clear"></div>