您好,欢迎访问一九零五行业门户网

以上代码是调用24小时内的数据,请教如何改成调用一个月或一年的数据

以下代码是调用24小时内的数据,请问怎么改成调用一个月或一年的数据
php code private function getlist($where='',$no_query = false) { global $_fanwe; if(!$no_query) { if(defined('is_cache_tpl')) $fields = ''; else $fields = ',g.post_count'; $page_args = array( 'city_py' => current_city_py, 'site' => intval($_fanwe['request']['site']), 'cat' => intval($_fanwe['request']['cat']), 'sort' => trim($_fanwe['request']['sort']), 'date' => trim($_fanwe['request']['date']), 'keyword' => trim($_fanwe['request']['keyword']), 'prices' => trim($_fanwe['request']['prices']), ); $site_id = 0; if($page_args['site'] > 0) { $site_id = $page_args['site']; $site_where = ' and gk.site_id = '.$page_args['site']; } else unset($page_args['site']); $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; } } else { $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 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 == china_city_py) { //全国不包含所有城市商品时 if($_fanwe['setting']['all_city'] == 0) $where.= and gk.city = '$city_name'; else { $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['cache']['city']['all'][china_city_py]['name']; $where.= and gk.city in ('$city_name','$quanguo_name'); } else { $where.= and gk.city = '$city_name'; } } //价格条件 $prices = ''; 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 getexpiredgoodscats($site_where.$where); $cate_id = 0; if($page_args['cat'] > 0) { $cate_id = &$page_args['cat']; $cateobj = $_fanwe['cache']['goods']['cats'][$cate_id]; $cate_ids = array(); 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).')'; else $where.= and gk.cate_id = '$cate_id'; } else 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.score desc','ba'=>'g.bought asc','bd'=>'g.bought desc','da'=>'discount asc','dd'=>'discount desc'); if(array_key_exists($sort,$sort_array)) $order = $sort_array[$sort]; else { unset($page_args['sort']); $sort = ''; } if(empty($order)) $order .= 'g.is_best desc,'.$insert_sort.',g.sort asc,g.id asc'; else $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'); }

其它类似信息

推荐信息