The above code is called in 24 hours of data, ask how to change to call one months or a year of data

Source: Internet
Author: User
The following code is called in 24 hours of data, how to change to call one months or a year of data
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[' req            Uest ' [' 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 [' max_time '] && $time >= $dates [' min_time ']) {$date = t                    Odate ($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 <= ' $max _time '"; $keyword = ";            if ($page _args[' keyword '! = ') {$page _args[' keyword '] = urldecode ($page _args[' keyw                Ord ']);                $keyword = & $page _args[' keyword ');                $keyword _query = mysqllikequote ($page _args[' keyword ');            $where. = "and (G.name like '% $keyword _query% ')";            } else unset ($page _args[' keyword ');            $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 = = china_city_py) {//national does not contain all city goods 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 A                SC '; }} elseif (current_city_py! = ") {//city displays National commodity 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 '";            }}//Price conditions $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 <= $price _max)";            } else unset ($page _args[' prices ');            $goods _cates = S (' goods ')->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;            er = ";            $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)) er = $sort _array[$sort];                else {unset ($page _args[' sort ');            $sort = "; } if (empty (er)) er. = ' G.IS_best DESC, '. $insert _sort. ', G.sort asc,g.id ASC ';            else er. = ', '. $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, er, $fields, $pager [' limit ']);        $goods _result[' ids '] = implode (', ', $goods _result[' IDs ');    } Include template (' Page/goods_index '); }
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.