当前位置: 首页>>代码示例>>PHP>>正文


PHP get_goods_list函数代码示例

本文整理汇总了PHP中get_goods_list函数的典型用法代码示例。如果您正苦于以下问题:PHP get_goods_list函数的具体用法?PHP get_goods_list怎么用?PHP get_goods_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_goods_list函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index()
 {
     global_run();
     $GLOBALS['tmpl']->caching = true;
     $GLOBALS['tmpl']->cache_lifetime = 600;
     //首页缓存10分钟
     $cache_id = md5(MODULE_NAME . ACTION_NAME . $GLOBALS['city']['id']);
     if (!$GLOBALS['tmpl']->is_cached('mall.html', $cache_id)) {
         init_app_page();
         //获取商城公告
         $notice_list = get_notice(0, array(0, 2));
         $GLOBALS['tmpl']->assign("notice_list", $notice_list);
         //输出首页推荐的分类
         $index_cates = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "shop_cate where is_delete = 0 and is_effect = 1 and recommend = 1 and pid = 0 order by sort");
         foreach ($index_cates as $k => $v) {
             $index_cates[$k]['deal_cate_type_list'] = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "shop_cate  where pid = " . $v['id'] . " order by sort limit 8");
             require_once APP_ROOT_PATH . "system/model/deal.php";
             $deal_result = get_goods_list(8, array(DEAL_ONLINE, DEAL_NOTICE), array("city_id" => $GLOBALS['city']['id'], "cid" => $v['id']), "", " d.buy_type <> 1 and d.is_shop = 1 and d.is_recommend = 1 ");
             $index_cates[$k]['deal_list'] = $deal_result['list'];
         }
         $GLOBALS['tmpl']->assign("index_cates", $index_cates);
         $GLOBALS['tmpl']->assign("drop_nav", "no_drop");
         //首页下拉菜单不输出
         $GLOBALS['tmpl']->assign("wrap_type", "1");
         //首页宽屏展示
     }
     $GLOBALS['tmpl']->display("mall.html", $cache_id);
 }
开发者ID:macall,项目名称:jsd,代码行数:28,代码来源:mallModule.class.php

示例2: index

 public function index()
 {
     $id = intval($_REQUEST['id']);
     if ($id == 0) {
         //分页
         $page = intval($_REQUEST['p']);
         if ($page == 0) {
             $page = 1;
         }
         $limit = ($page - 1) * app_conf("DEAL_PAGE_SIZE") . "," . app_conf("DEAL_PAGE_SIZE");
         $condition = " brand_promote = 1 and (end_time = 0 or end_time > " . get_gmtime() . ") ";
         $brand_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "brand where " . $condition . " order by time_status asc,sort desc limit " . $limit);
         $brand_total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "brand where " . $condition);
         foreach ($brand_list as $k => $v) {
             $brand_list[$k]['url'] = url("shop", "discount#index", array("id" => $v['id']));
             $brand_list[$k]['time_status'] = syn_brand_status($v['id']);
         }
         $page = new Page($brand_total, app_conf("DEAL_PAGE_SIZE"));
         //初始化分页对象
         $p = $page->show();
         $GLOBALS['tmpl']->assign('pages', $p);
         //开始输出当前的site_nav
         $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => APP_ROOT . "/");
         $site_nav[] = array('name' => $GLOBALS['lang']['BRAND_DISCOUNT'], 'url' => url("shop", "discount#index"));
         $GLOBALS['tmpl']->assign("site_nav", $site_nav);
         //输出当前的site_nav
         $GLOBALS['tmpl']->assign("brand_list", $brand_list);
         $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['BRAND_DISCOUNT']);
         $GLOBALS['tmpl']->assign("page_keyword", $GLOBALS['lang']['BRAND_DISCOUNT']);
         $GLOBALS['tmpl']->assign("page_description", $GLOBALS['lang']['BRAND_DISCOUNT']);
         //输出右侧的推荐
         $condition_rec = "buy_type <> 1 and is_effect =1 and is_delete = 0 and is_shop =1 and brand_promote = 1 and (begin_time = 0 or begin_time <= " . get_gmtime() . ") and (end_time = 0 or end_time > " . get_gmtime() . ") ";
         $rec_list = get_goods_list(intval(app_conf("REC_CATE_GOODS_LIMIT")), 0, $condition_rec);
         $GLOBALS['tmpl']->assign("rec_list", $rec_list['list']);
         $GLOBALS['tmpl']->display("discount_index.html", $cache_id);
     } else {
         $GLOBALS['tmpl']->caching = true;
         $cache_id = md5(MODULE_NAME . "show" . trim($_REQUEST['id']) . $GLOBALS['deal_city']['id']);
         if (!$GLOBALS['tmpl']->is_cached('brand_info.html', $cache_id)) {
             $condition = " brand_promote = 1 and (end_time = 0 or end_time > " . get_gmtime() . ") ";
             $brand_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "brand where id = " . $id . " and " . $condition);
             if ($brand_info) {
                 //开始输出当前的site_nav
                 $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => APP_ROOT . "/");
                 $site_nav[] = array('name' => $GLOBALS['lang']['BRAND_DISCOUNT'], 'url' => url("shop", "discount#index"));
                 $site_nav[] = array('name' => $brand_info['name'], 'url' => url("shop", "discount#index", array("id" => $brand_info['id'])));
                 $GLOBALS['tmpl']->assign("site_nav", $site_nav);
                 //输出当前的site_nav
                 $GLOBALS['tmpl']->assign("page_title", $brand_info['name']);
                 $GLOBALS['tmpl']->assign("page_keyword", $brand_info['name']);
                 $GLOBALS['tmpl']->assign("page_description", $brand_info['name']);
             } else {
                 app_redirect(APP_ROOT . "/");
             }
         }
         $GLOBALS['tmpl']->display("brand_info.html", $cache_id);
     }
 }
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:58,代码来源:discountModule.class.php

示例3: index

 public function index()
 {
     require_once APP_ROOT_PATH . 'app/Lib/shop_lib.php';
     $catalog_id = intval($GLOBALS['request']['catalog_id']);
     //商品分类ID
     $city_id = intval($GLOBALS['request']['city_id']);
     //城市分类ID
     $page = intval($GLOBALS['request']['page']);
     //分页
     $keyword = strim($GLOBALS['request']['keyword']);
     $page = $page == 0 ? 1 : $page;
     $page_size = PAGE_SIZE;
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $condition = " deal_type = 0 ";
     if ($keyword) {
         $kws_div = div_str($keyword);
         foreach ($kws_div as $k => $item) {
             $kws[$k] = str_to_unicode_string($item);
         }
         $ukeyword = implode(" ", $kws);
         $condition .= " and  (match(tag_match,name_match,locate_match,shop_cate_match) against('" . $ukeyword . "' IN BOOLEAN MODE) or name like '%" . $keyword . "%')";
     }
     $merchant_id = intval($GLOBALS['request']['merchant_id']);
     if ($merchant_id > 0) {
         $deal_ids = $GLOBALS['db']->getOne("select group_concat(deal_id) from " . DB_PREFIX . "deal_location_link where location_id = " . $merchant_id);
         if ($deal_ids) {
             $condition .= " and id in (" . $deal_ids . ") ";
         }
     }
     $deals = get_goods_list($limit, $catalog_id, $condition, "sort desc,id desc", false, $city_id);
     $list = $deals['list'];
     $count = $deals['count'];
     $page_total = ceil($count / $page_size);
     $root = array();
     $root['return'] = 1;
     $goodses = array();
     foreach ($list as $item) {
         //$goods = array();
         $goods = getGoodsArray($item);
         $goodses[] = $goods;
     }
     $root['item'] = $goodses;
     $root['page'] = array("page" => $page, "page_total" => $page_total);
     output($root);
 }
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:45,代码来源:goodslist.action.php

示例4: action_search_goods

/**
 *  搜索商品
 */
function action_search_goods()
{
    $user = $GLOBALS['user'];
    $_CFG = $GLOBALS['_CFG'];
    $_LANG = $GLOBALS['_LANG'];
    $smarty = $GLOBALS['smarty'];
    $db = $GLOBALS['db'];
    $ecs = $GLOBALS['ecs'];
    $user_id = $_SESSION['user_id'];
    check_authz_json('pre_sale');
    include_once ROOT_PATH . 'includes/cls_json.php';
    $json = new JSON();
    //非虚拟商品
    $filter = $json->decode($_GET['JSON']);
    $filter->is_virtual = 0;
    $arr = get_goods_list($filter);
    make_json_result($arr);
}
开发者ID:seanguo166,项目名称:yinoos,代码行数:21,代码来源:pre_sale.php

示例5: index


//.........这里部分代码省略.........
     $ordertype[] = array("name" => "销量最高", "sc" => "buy_count");
     $ordertype[] = array("name" => "价格最高", "sc" => "price_desc");
     $ordertype[] = array("name" => "价格最低", "sc" => "price_asc");
     foreach ($ordertype as $k => $v) {
         $tmp_url_param = $url_param;
         if ($quanname) {
             $tmp_url_param['quanname'] = $quanname;
         }
         if ($catename) {
             $tmp_url_param['catename'] = $catename;
         }
         if ($keyword) {
             $tmp_url_param['keyword'] = $keyword;
         }
         $tmp_url_param['order_type'] = $v['sc'];
         $turl = wap_url("index", "goodslist", $tmp_url_param);
         $url = str_replace('sjmapi', 'wap', $turl);
         $ordertype[$k]["url"] = $url;
     }
     $root['ordertype'] = $ordertype;
     /*排序*/
     if ($order_type == 'avg_point') {
         $order = " avg_point desc,id desc ";
     } elseif ($order_type == 'newest') {
         $order = " create_time desc,id desc ";
     } elseif ($order_type == 'buy_count') {
         $order = " buy_count desc,id desc ";
     } elseif ($order_type == 'price_asc') {
         $order = " current_price asc,id desc ";
     } elseif ($order_type == 'price_desc') {
         $order = " current_price desc,id desc ";
     } else {
         $order = "sort desc,id desc ";
     }
     $page = $page == 0 ? 1 : $page;
     $page_size = PAGE_SIZE;
     $limit = ($page - 1) * $page_size . "," . $page_size;
     //buy_type = 0 普通商品;1积分商品
     $condition = " buy_type = 0  and is_shop=1";
     if ($keyword) {
         $kws_div = div_str($keyword);
         foreach ($kws_div as $k => $item) {
             $kws[$k] = str_to_unicode_string($item);
         }
         $ukeyword = implode(" ", $kws);
         $condition .= " and  (match(tag_match,name_match,locate_match,shop_cate_match) against('" . $ukeyword . "' IN BOOLEAN MODE) or name like '%" . $keyword . "%')";
     }
     $merchant_id = intval($GLOBALS['request']['merchant_id']);
     if ($merchant_id > 0) {
         $deal_ids = $GLOBALS['db']->getOne("select group_concat(deal_id) from " . DB_PREFIX . "deal_location_link where location_id = " . $merchant_id);
         if ($deal_ids) {
             $condition .= " and id in (" . $deal_ids . ") ";
         } else {
             $condition .= " and id ='' ";
         }
     }
     //根据传入的商圈ID来搜索该商圈下的商品
     if ($quan_id > 0) {
         $condition .= " and brand_id = " . $quan_id;
     }
     //get_goods_list($limit,$type=array(DEAL_ONLINE,DEAL_HISTORY,DEAL_NOTICE),$param=array("cid"=>0,"city_id"=>0), $join='', $where='',$orderby = '')
     $deals = get_goods_list($limit, array(DEAL_ONLINE, DEAL_HISTORY), array("cid" => $catalog_id, "city_id" => $city_id), '', $condition, $order);
     $condition = $deals['condition'];
     $sql = "select count(*) from " . DB_PREFIX . "deal as d where  " . $condition;
     $count = $GLOBALS['db']->getOne($sql);
     $list = $deals['list'];
     $page_total = ceil($count / $page_size);
     $goodses = array();
     foreach ($list as $item) {
         //$goods = array();
         $goods = getGoodsArray($item);
         $goods['image'] = get_abs_img_root(get_spec_image($item['img'], 140, 85, 0));
         $goodses[] = $goods;
     }
     $root['item'] = $goodses;
     $root['page'] = array("page" => $page, "page_total" => $page_total, "page_size" => $page_size);
     //$root['quan_list'] = getCityList();
     /*
     //输出城市
     $root['city_list']=getCityList();
     //输出商圈
     $quan_list=getQuanList($city_id);
     $root['quan_list2'] = $quan_list;
     */
     //$root['bcate_list'] = $bcate_list;
     //$root['quan_list'] = $quan_list;
     if ($bcate_list === false) {
         $root['bcate_list'] = array();
     } else {
         $root['bcate_list'] = $bcate_list;
     }
     if ($quan_list === false) {
         $root['quan_list'] = array();
     } else {
         $root['quan_list'] = $quan_list;
     }
     $root['page_title'] = "商品列表";
     $root['city_name'] = $city_name;
     output($root);
 }
开发者ID:macall,项目名称:jishida,代码行数:101,代码来源:goodslist.action.php

示例6: index

 public function index()
 {
     $GLOBALS['tmpl']->caching = true;
     $GLOBALS['tmpl']->cache_lifetime = 60;
     //首页缓存10分钟
     $field = es_cookie::get("shop_sort_field");
     $field_sort = es_cookie::get("shop_sort_type");
     $cache_id = md5(MODULE_NAME . ACTION_NAME . implode(",", $_REQUEST) . $field . $field_sort);
     if (!$GLOBALS['tmpl']->is_cached("page/score.html", $cache_id)) {
         require APP_ROOT_PATH . 'app/Lib/page.php';
         $cates = intval($_REQUEST['cates']);
         $GLOBALS['tmpl']->assign("cates", $cates);
         $integral = intval($_REQUEST['integral']);
         $GLOBALS['tmpl']->assign("integral", $integral);
         $sort = intval($_REQUEST['sort']);
         //1.最新  2.热门  3.积分
         $GLOBALS['tmpl']->assign("sort", $sort);
         //输出投标列表
         $page = intval($_REQUEST['p']);
         if ($page == 0) {
             $page = 1;
         }
         $limit = ($page - 1) * app_conf("DEAL_PAGE_SIZE") . "," . app_conf("DEAL_PAGE_SIZE");
         $condition = " 1=1";
         if ($sort == 1) {
             $condition .= " AND is_new = 1";
         } elseif ($sort == 2) {
             $condition .= " AND is_hot = 1 ";
         } elseif ($sort == 3) {
             $orderby = " score desc";
         }
         if ($cates > 0) {
             $cates_id = $GLOBALS['db']->getAll("select id from " . DB_PREFIX . "goods_cate where pid = " . $cates);
             $flatmap = array_map("array_pop", $cates_id);
             $cates_ids = implode(',', $flatmap);
             if ($cates_ids == "") {
                 $condition .= " AND cate_id in (" . $cates . ") ";
             } else {
                 $condition .= " AND cate_id in (" . $cates . "," . $cates_ids . ") ";
             }
         }
         if ($integral == 0) {
             $condition .= "";
         } elseif ($integral == 1) {
             $condition .= " AND score  <= 500";
         } elseif ($integral == 2) {
             $condition .= " AND score  between 500 and 1000";
         } elseif ($integral == 3) {
             $condition .= " AND score  between 1000 and 3000";
         } elseif ($integral == 4) {
             $condition .= " AND score  between 3000 and 5000";
         } else {
             $condition .= " AND score  >= 5000";
         }
         $result = get_goods_list($limit, $condition, $orderby);
         $GLOBALS['tmpl']->assign("goods_list", $result['list']);
         $page_args['cates'] = $cates;
         $page_args['integral'] = $integral;
         $page_args['sort'] = $sort;
         //商品类别
         $cates_urls = load_auto_cache("score_cates");
         //$cates_urls = $GLOBALS['db']->getAll("SELECT id,name FROM ".DB_PREFIX."goods_cate WHERE is_effect=1 and is_delete = 0 and pid= 0");
         $cates_url = array();
         $cates_url[0]['id'] = 0;
         $cates_url[0]['name'] = "不限";
         $tmp_args = $page_args;
         $tmp_args['cates'] = 0;
         $cates_url[0]['url'] = url("index", "score#index", $tmp_args);
         foreach ($cates_urls as $k => $v) {
             $cates_url[$k + 1]['id'] = $v['id'];
             $cates_url[$k + 1]['name'] = $v['name'];
             $tmp_args = $page_args;
             $tmp_args['cates'] = $v['id'];
             $cates_url[$k + 1]['url'] = url("index", "score#index", $tmp_args);
         }
         $GLOBALS['tmpl']->assign('cates_url', $cates_url);
         //积分范围
         $integral_url = array(array("name" => "不限"), array("name" => "500积分以下"), array("name" => "500-1000积分"), array("name" => "1000-3000积分"), array("name" => "3000-5000积分"), array("name" => "5000积分以上"));
         foreach ($integral_url as $k => $v) {
             $tmp_args = $page_args;
             $tmp_args['integral'] = $k;
             $integral_url[$k]['url'] = url("index", "score#index", $tmp_args);
         }
         $GLOBALS['tmpl']->assign('integral_url', $integral_url);
         //排序
         $sort_url = array(array("name" => "默认排序"), array("name" => "最新"), array("name" => "热门"), array("name" => "积分"));
         foreach ($sort_url as $k => $v) {
             $tmp_args = $page_args;
             $tmp_args['sort'] = $k;
             $sort_url[$k]['url'] = url("index", "score#index", $tmp_args);
         }
         $GLOBALS['tmpl']->assign('sort_url', $sort_url);
         $page_pram = "";
         foreach ($page_args as $k => $v) {
             $page_pram .= "&" . $k . "=" . $v;
         }
         $page = new Page($result['count'], app_conf("DEAL_PAGE_SIZE"), $page_pram);
         //初始化分页对象
         $p = $page->show();
         $GLOBALS['tmpl']->assign('pages', $p);
//.........这里部分代码省略.........
开发者ID:eliu03,项目名称:fanweP2P,代码行数:101,代码来源:scoreModule.class.php

示例7: insert_load_head_history

function insert_load_head_history()
{
    require_once APP_ROOT_PATH . 'system/model/deal.php';
    $history_list = array();
    //浏览历史
    $history_ids = get_view_history("deal");
    if ($history_ids) {
        $ids_conditioin = " d.id in (" . implode(",", $history_ids) . ") ";
        $history_deal_list = get_deal_list(2, array(DEAL_ONLINE), array("city_id" => $GLOBALS['city']['id']), "", $ids_conditioin);
        //重新组装排序
        foreach ($history_ids as $k => $v) {
            foreach ($history_deal_list['list'] as $history_item) {
                if ($history_item['id'] == $v) {
                    $history_list[] = $history_item;
                }
            }
        }
    }
    $history_ids = get_view_history("shop");
    if ($history_ids) {
        $ids_conditioin = " d.id in (" . implode(",", $history_ids) . ") ";
        $history_deal_list = get_goods_list(2, array(DEAL_ONLINE), array("city_id" => 0), "", $ids_conditioin);
        //重新组装排序
        foreach ($history_ids as $k => $v) {
            foreach ($history_deal_list['list'] as $history_item) {
                if ($history_item['id'] == $v) {
                    $history_list[] = $history_item;
                }
            }
        }
    }
    $GLOBALS['tmpl']->assign("history_list", $history_list);
    $html = $GLOBALS['tmpl']->fetch("inc/insert/load_head_history.html");
    return $html;
}
开发者ID:macall,项目名称:jsd,代码行数:35,代码来源:insert_libs.php

示例8: index

 public function index()
 {
     $GLOBALS['tmpl']->caching = true;
     $cache_id = md5(MODULE_NAME . ACTION_NAME . $GLOBALS['deal_city']['id']);
     if (!$GLOBALS['tmpl']->is_cached('mall.html', $cache_id)) {
         //输出商城分类
         $cate_tree = get_cate_tree(0, 1);
         $top_count = 0;
         foreach ($cate_tree as $k => $v) {
             if ($v['level'] == 0) {
                 $top_count++;
             }
             //				if($top_count>6)
             //				{
             //					$cate_tree[$k]['is_hide'] = 1;
             //				}
         }
         $GLOBALS['tmpl']->assign("cate_tree", $cate_tree);
         //获取推荐
         $hot_list = get_goods_list(intval(app_conf("REC_HOT_LIMIT")), 0, " is_hot = 1 and buy_type <> 1", "", false);
         $best_list = get_goods_list(intval(app_conf("REC_BEST_LIMIT")), 0, " is_best = 1 and buy_type <> 1 ", "", false);
         $new_list = get_goods_list(intval(app_conf("REC_NEW_LIMIT")), 0, " is_new = 1 and buy_type <> 1 ", "", false);
         $GLOBALS['tmpl']->assign("inc_var", array('title' => $GLOBALS['lang']['HOT_LIST'], 'list' => $hot_list['list'], 'url' => url("shop", "rec#rhot")));
         $hot_span_goods_html = $GLOBALS['tmpl']->fetch("inc/span_goods.html");
         $GLOBALS['tmpl']->assign("hot_span_goods_html", $hot_span_goods_html);
         $GLOBALS['tmpl']->assign("inc_var", array('title' => $GLOBALS['lang']['BEST_LIST'], 'list' => $best_list['list'], 'url' => url("shop", "rec#rbest")));
         $best_span_goods_html = $GLOBALS['tmpl']->fetch("inc/span_goods.html");
         $GLOBALS['tmpl']->assign("best_span_goods_html", $best_span_goods_html);
         $GLOBALS['tmpl']->assign("inc_var", array('title' => $GLOBALS['lang']['NEW_LIST'], 'list' => $new_list['list'], 'url' => url("shop", "rec#rnew")));
         $new_span_goods_html = $GLOBALS['tmpl']->fetch("inc/span_goods.html");
         $GLOBALS['tmpl']->assign("new_span_goods_html", $new_span_goods_html);
         $recommend_cate = $GLOBALS['db']->getAll("select id,name,uname from " . DB_PREFIX . "shop_cate where grade = 0 order by sort desc");
         //输出分类商品
         $recommend_cate_html = "";
         foreach ($recommend_cate as $cate => $catev) {
             require_once APP_ROOT_PATH . "system/utils/child.php";
             $ids_util = new child("shop_cate");
             $ids = $ids_util->getChildIds($catev['id']);
             $ids[] = $catev['id'];
             $brand_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "brand where shop_cate_id in (" . implode(",", $ids) . ") limit 8");
             foreach ($brand_list as $kk => $brand_item) {
                 $brand_list[$kk]['url'] = url("shop", "brand#index", array("id" => $brand_item['id']));
             }
             //商城推荐分类列表
             $time = get_gmtime();
             $count_sql = "select count(*) from " . DB_PREFIX . "deal where is_effect = 1 and is_delete = 0  and p_shop_cate_id=" . $catev['id'];
             $sql = "select * from " . DB_PREFIX . "deal where is_effect = 1 and is_delete = 0  and p_shop_cate_id=" . $catev['id'];
             $city = get_current_deal_city();
             $city_id = $city['id'];
             if ($city_id > 0) {
                 $ids = load_auto_cache("deal_city_belone_ids", array("city_id" => $city_id));
                 if ($ids) {
                     $sql .= " and city_id in (" . implode(",", $ids) . ")";
                     $count_sql .= " and city_id in (" . implode(",", $ids) . ")";
                 }
             }
             $sql .= " and buy_type <> 1 ";
             $count_sql .= " and buy_type <> 1 ";
             $sql .= " order by sort desc limit 10 ";
             $deals = $GLOBALS['db']->getAll($sql);
             $deals_count = $GLOBALS['db']->getOne($count_sql);
             if ($deals) {
                 foreach ($deals as $k => $deal) {
                     if ($deal['buy_type'] == 1) {
                         $module = "exchange";
                     } else {
                         $module = "goods";
                     }
                     if ($deal['uname'] != '') {
                         $durl = url("shop", $module, array("id" => $deal['uname']));
                     } else {
                         $durl = url("shop", $module, array("id" => $deal['id']));
                     }
                     $deal['url'] = $durl;
                     $deals[$k] = $deal;
                 }
             }
             $cate_list = array('list' => $deals, 'count' => $deals_count);
             //$cate_list=$catev['id'];
             //$cate_list['sd'] = get_goods_list(intval(app_conf("REC_CATE_GOODS_LIMIT")),$catev['id']," buy_type <> 1 ","",false);
             $cate_title = $catev['name'];
             if ($catev['uname'] != "") {
                 $curl = url("shop", "cate#index", array("id" => $catev['uname']));
             } else {
                 $curl = url("shop", "cate#index", array("id" => $catev['id']));
             }
             $GLOBALS['tmpl']->assign("inc_var", array('id' => $catev['id'], 'brand_list' => $brand_list, 'title' => $cate_title, 'list' => $cate_list['list'], 'url' => $curl));
             $recommend_cate_html .= $GLOBALS['tmpl']->fetch("inc/recommend_cate_goods.html");
         }
         $GLOBALS['tmpl']->assign("recommend_cate_html", $recommend_cate_html);
         $GLOBALS['tmpl']->assign("page_title", app_conf("MALL_SHOP_TITLE"));
         $GLOBALS['tmpl']->assign("page_keyword", app_conf("MALL_SHOP_TITLE"));
         $GLOBALS['tmpl']->assign("page_description", app_conf("MALL_SHOP_TITLE"));
         //输出商城公告
         $notice_list = get_notice(0, array(0, 2));
         $GLOBALS['tmpl']->assign("notice_list", $notice_list);
     }
     $GLOBALS['tmpl']->display("mall.html", $cache_id);
 }
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:99,代码来源:mallModule.class.php

示例9: store_load_supplier_shop

 public function store_load_supplier_shop()
 {
     $store_id = intval($_REQUEST['store_id']);
     $page_size = 5;
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     require_once APP_ROOT_PATH . "system/model/deal.php";
     $supplier_data_result = get_goods_list($limit, array(DEAL_ONLINE, DEAL_NOTICE), array(), " left join " . DB_PREFIX . "deal_location_link as l on d.id = l.deal_id ", " d.buy_type <> 1 and d.is_shop = 1 and l.location_id =" . $store_id);
     $GLOBALS['tmpl']->assign("supplier_data_list", $supplier_data_result['list']);
     //分页
     require_once APP_ROOT_PATH . "app/Lib/page.php";
     $total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal as d left join " . DB_PREFIX . "deal_location_link as l on d.id = l.deal_id where " . $supplier_data_result['condition']);
     $page = new Page($total, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign('total', $total);
     $GLOBALS['tmpl']->assign('page_size', $page_size);
     $data['html'] = $GLOBALS['tmpl']->fetch("inc/store_page/store_supplier_shop.html");
     ajax_return($data);
 }
开发者ID:macall,项目名称:jsd,代码行数:24,代码来源:ajaxModule.class.php

示例10: index


//.........这里部分代码省略.........
     				array("name"=>"xxx","key"=>"xxx","type"=>"desc|asc","url"=>"xxx","current"=>"true|false")		
     			),
     			"range"	=> array(
     				array
     				(
     					array("name"=>"xxx","url"=>"xxx","selected"=>"true|false"),
     					array("name"=>"xxx","url"=>"xxx","selected"=>"true|false"),
     					array("name"=>"xxx","url"=>"xxx","selected"=>"true|false"),
     					array("name"=>"xxx","url"=>"xxx","selected"=>"true|false"),
     				)
     			),
     			"tag"	=> array(
     				array("name"=>"xxx","url"=>"xxx","checked"=>"true|false")
     			)		
     		); */
     //默认排序
     $tmp_url_param = $url_param;
     unset($tmp_url_param['type']);
     unset($tmp_url_param['sort']);
     if (empty($url_param['sort'])) {
         $current = true;
     } else {
         $current = false;
     }
     $sort_list[] = array("name" => "默认排序", "current" => $current, "url" => url("index", "scores", $tmp_url_param));
     //价格排序
     $tmp_url_param = $url_param;
     if ($tmp_url_param['sort'] == "return_score") {
         if ($tmp_url_param['type'] == "desc") {
             $tmp_url_param['type'] = "asc";
             $c_sort_type = "desc";
         } else {
             $tmp_url_param['type'] = "desc";
             $c_sort_type = "asc";
         }
         $current = true;
     } else {
         $tmp_url_param['sort'] = "return_score";
         $tmp_url_param['type'] = "desc";
         $c_sort_type = "desc";
         $current = false;
     }
     $sort_list[] = array("name" => "积分", "key" => "return_score", "type" => $c_sort_type, "current" => $current, "url" => url("index", "scores", $tmp_url_param));
     //销量排序
     $tmp_url_param = $url_param;
     if ($tmp_url_param['sort'] == "buy_count") {
         if ($tmp_url_param['type'] == "desc") {
             $tmp_url_param['type'] = "asc";
             $c_sort_type = "desc";
         } else {
             $tmp_url_param['type'] = "desc";
             $c_sort_type = "asc";
         }
         $current = true;
     } else {
         $tmp_url_param['sort'] = "buy_count";
         $tmp_url_param['type'] = "desc";
         $c_sort_type = "desc";
         $current = false;
     }
     $sort_list[] = array("name" => "销量", "key" => "buy_count", "type" => $c_sort_type, "current" => $current, "url" => url("index", "scores", $tmp_url_param));
     $sort_row_data['sort'] = $sort_list;
     $ext_condition = "  d.buy_type = 1 and d.is_shop = 1 ";
     $GLOBALS['tmpl']->assign("sort_row_data", $sort_row_data);
     //开始获取商品
     //获取排序条件
     //积分商城积分排序相反
     if ($url_param['sort'] == "return_score") {
         $sort_type = $url_param['type'] == "desc" ? "asc" : "desc";
     } else {
         $sort_type = $url_param['type'];
     }
     if ($url_param['sort']) {
         $sort_field = "d." . $url_param['sort'] . " " . $sort_type;
     }
     require_once APP_ROOT_PATH . "system/model/deal.php";
     require_once APP_ROOT_PATH . "app/Lib/page.php";
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("DEAL_PAGE_SIZE") . "," . app_conf("DEAL_PAGE_SIZE");
     $condition_param = $url_param;
     $condition_param['city_id'] = $GLOBALS['city']['id'];
     $deal_result = get_goods_list($limit, array(DEAL_ONLINE, DEAL_NOTICE), $condition_param, "", $ext_condition, $sort_field);
     $deal_list = $deal_result['list'];
     $total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal as d where " . $deal_result['condition']);
     $page = new Page($total, app_conf("DEAL_PAGE_SIZE"));
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign('deal_list', $deal_list);
     $side_deal_result = get_goods_list(app_conf("SIDE_DEAL_COUNT"), array(DEAL_ONLINE, DEAL_NOTICE), array("city_id" => $GLOBALS['city']['id']), "", " d.buy_type = 1 and d.is_shop = 1 ", " d.buy_count desc ");
     $side_deal_list = $side_deal_result['list'];
     $GLOBALS['tmpl']->assign('side_deal_list', $side_deal_list);
     $GLOBALS['tmpl']->assign("page_title", $page_title);
     $GLOBALS['tmpl']->assign("page_keyword", $page_keyword);
     $GLOBALS['tmpl']->assign("page_description", $page_description);
     $GLOBALS['tmpl']->display("scores.html");
 }
开发者ID:macall,项目名称:jsd,代码行数:101,代码来源:scoresModule.class.php

示例11: index

 public function index()
 {
     $GLOBALS['tmpl']->caching = true;
     $cache_id = md5(MODULE_NAME . ACTION_NAME . trim($_REQUEST['id']) . intval($_REQUEST['p']) . $GLOBALS['deal_city']['id']);
     if (!$GLOBALS['tmpl']->is_cached('score_list.html', $cache_id)) {
         //获取当前页的团购商品列表
         //分页
         $page = intval($_REQUEST['p']);
         if ($page == 0) {
             $page = 1;
         }
         $limit = ($page - 1) * app_conf("DEAL_PAGE_SIZE") . "," . app_conf("DEAL_PAGE_SIZE");
         $id = intval($_REQUEST['id']);
         if ($id == 0) {
             $uname = addslashes(trim($_REQUEST['id']));
         }
         $cate_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "shop_cate where id = " . $id . " or (uname = '" . $uname . "' and uname <> '')");
         //输出商城分类
         $cate_tree = get_cate_tree($cate_item['id']);
         $GLOBALS['tmpl']->assign("cate_tree", $cate_tree);
         $result = get_goods_list($limit, intval($cate_item['id']), 'buy_type = 1', '');
         $GLOBALS['tmpl']->assign("list", $result['list']);
         $page = new Page($result['count'], app_conf("DEAL_PAGE_SIZE"));
         //初始化分页对象
         $p = $page->show();
         $GLOBALS['tmpl']->assign('pages', $p);
         //开始输出当前的site_nav
         $cates = array();
         $cate = $cate_item;
         do {
             $cates[] = $cate;
             $pid = intval($cate['pid']);
             $cate = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "shop_cate where is_effect =1 and is_delete =0 and id = " . $pid);
         } while ($pid != 0);
         foreach ($cates as $cate_row) {
             $page_title .= $cate_row['name'] . " - ";
             $page_kd .= $cate_row['name'] . ",";
         }
         $page_title = substr($page_title, 0, -3);
         krsort($cates);
         $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => APP_ROOT . "/");
         if ($cate_item) {
             foreach ($cates as $cate_row) {
                 if ($cate_row['uname'] != '') {
                     $curl = url("shop", "score#index", array("id" => $cate_row['uname']));
                 } else {
                     $curl = url("shop", "score#index", array("id" => $cate_row['id']));
                 }
                 $site_nav[] = array('name' => $cate_row['name'], 'url' => $curl);
             }
         } else {
             $site_nav[] = array('name' => $GLOBALS['lang']['SCORE_LIST'], 'url' => url("shop", "score"));
         }
         $GLOBALS['tmpl']->assign("site_nav", $site_nav);
         //输出当前的site_nav
         $GLOBALS['tmpl']->assign("page_title", $page_title . $GLOBALS['lang']['SCORE_LIST']);
         $GLOBALS['tmpl']->assign("page_keyword", $page_kd . $GLOBALS['lang']['SCORE_LIST'] . ",");
         $GLOBALS['tmpl']->assign("page_description", $page_kd . $GLOBALS['lang']['SCORE_LIST'] . ",");
         if (!$result['list'] && intval($_REQUEST['p']) > 0) {
             $GLOBALS['tmpl']->display("score_list.html");
             exit;
         }
     }
     $GLOBALS['tmpl']->display("score_list.html", $cache_id);
 }
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:65,代码来源:scoreModule.class.php

示例12: index

 public function index()
 {
     global_run();
     $GLOBALS['tmpl']->caching = true;
     $GLOBALS['tmpl']->cache_lifetime = 600;
     //首页缓存10分钟
     $cache_id = md5(MODULE_NAME . ACTION_NAME . $GLOBALS['city']['id']);
     if (!$GLOBALS['tmpl']->is_cached('index.html', $cache_id)) {
         init_app_page();
         $GLOBALS['tmpl']->assign("drop_nav", "no_drop");
         //首页下拉菜单不输出
         $GLOBALS['tmpl']->assign("wrap_type", "1");
         //首页宽屏展示
         //获取首页公告
         $notice_list = get_notice(0, array(0, 1));
         $GLOBALS['tmpl']->assign("notice_list", $notice_list);
         //获取热门团购分类
         $tuan_cate = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_cate where is_delete = 0 and is_effect = 1 order by sort asc");
         foreach ($tuan_cate as $k => $v) {
             $tuan_cate[$k]['url'] = url("index", "tuan", array("cid" => $v['id']));
         }
         $GLOBALS['tmpl']->assign("tuan_cate", $tuan_cate);
         //输出热门团购标签
         $tuan_tag = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_cate_type as dct left join " . DB_PREFIX . "deal_cate_type_link as dctl on dct.id = dctl.deal_cate_type_id  order by dct.sort limit 15");
         foreach ($tuan_tag as $k => $v) {
             $tuan_tag[$k]['url'] = url("index", "tuan", array("cid" => $v['cate_id'], "tid" => $v['id']));
         }
         $GLOBALS['tmpl']->assign("tuan_tag", $tuan_tag);
         //输出团购地区
         $tuan_area = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "area where city_id = " . intval($GLOBALS['city']['id']) . " and pid > 0 order by sort limit 50");
         foreach ($tuan_area as $k => $v) {
             $tuan_area[$k]['url'] = url("index", "tuan", array("aid" => $v['pid'], "qid" => $v['id']));
         }
         $GLOBALS['tmpl']->assign("tuan_area", $tuan_area);
         //输出首页推荐的分类
         $index_cates = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_cate where is_delete = 0 and is_effect = 1 and rec_youhui = 1 order by sort");
         foreach ($index_cates as $k => $v) {
             $index_cates[$k]['deal_cate_type_list'] = $GLOBALS['db']->getAll("select dct.* from " . DB_PREFIX . "deal_cate_type as dct left join " . DB_PREFIX . "deal_cate_type_link as dctl on dct.id = dctl.deal_cate_type_id where dctl.cate_id = " . $v['id'] . " and dct.is_recommend = 1 order by dct.sort");
             require_once APP_ROOT_PATH . "system/model/deal.php";
             $deal_result = get_deal_list(8, array(DEAL_ONLINE, DEAL_NOTICE), array("city_id" => $GLOBALS['city']['id'], "cid" => $v['id']), "", " d.buy_type <> 1 and d.is_shop = 0 and d.is_recommend = 1 ");
             $index_cates[$k]['deal_list'] = $deal_result['list'];
         }
         $GLOBALS['tmpl']->assign("index_cates", $index_cates);
         //输出首页商城推荐分类
         $index_mall_cates = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "shop_cate where is_delete = 0 and is_effect = 1 and recommend = 1 and pid = 0 order by sort");
         foreach ($index_mall_cates as $k => $v) {
             $index_mall_cates[$k]['deal_cate_type_list'] = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "shop_cate  where pid = " . $v['id'] . " order by sort limit 8");
             require_once APP_ROOT_PATH . "system/model/deal.php";
             $deal_result = get_goods_list(8, array(DEAL_ONLINE, DEAL_NOTICE), array("city_id" => $GLOBALS['city']['id'], "cid" => $v['id']), "", " d.buy_type <> 1 and d.is_shop = 1 and d.is_recommend = 1 ");
             $index_mall_cates[$k]['deal_list'] = $deal_result['list'];
         }
         $GLOBALS['tmpl']->assign("index_mall_cates", $index_mall_cates);
         //输出推荐门店
         require_once APP_ROOT_PATH . "system/model/supplier.php";
         $store_result = get_location_list(app_conf("INDEX_SUPPLIER_COUNT"), array("city_id" => intval($GLOBALS['city']['id'])), "", " is_recommend=1 AND is_effect = 1 ", " is_verify desc,sort desc ");
         $GLOBALS['tmpl']->assign("store_list", $store_result['list']);
         //输出首页推荐的优惠券
         require_once APP_ROOT_PATH . "system/model/youhui.php";
         $youhui_result = get_youhui_list(20, array(YOUHUI_ONLINE), array("city_id" => $GLOBALS['city']['id']), "", "y.is_recommend = 1");
         $GLOBALS['tmpl']->assign("youhui_list", $youhui_result['list']);
         //输出友情链接
         $links = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "link where is_effect = 1 and show_index = 1  order by sort desc");
         foreach ($links as $kk => $vv) {
             if (substr($vv['url'], 0, 7) == 'http://') {
                 $links[$kk]['url'] = str_replace("http://", "", $vv['url']);
             }
         }
         $GLOBALS['tmpl']->assign("links", $links);
     }
     $GLOBALS['tmpl']->display("index.html", $cache_id);
 }
开发者ID:macall,项目名称:jsd,代码行数:71,代码来源:indexModule.class.php

示例13: index

 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (empty($GLOBALS['user_info'])) {
         app_redirect(url("index", "user#login"));
     }
     require_once APP_ROOT_PATH . "system/model/review.php";
     $order_item_id = intval($_REQUEST['order_item_id']);
     //订单商品ID
     $youhui_log_id = intval($_REQUEST['youhui_log_id']);
     //优惠券领取日志ID
     $event_submit_id = intval($_REQUEST['event_submit_id']);
     //活动报名日志ID
     if ($order_item_id > 0) {
         $deal_id = intval($GLOBALS['db']->getOne("select deal_id from " . DB_PREFIX . "deal_order_item where id = " . $order_item_id));
     } else {
         $deal_id = intval($_REQUEST['deal_id']);
     }
     if ($youhui_log_id > 0) {
         $youhui_id = intval($GLOBALS['db']->getOne("select youhui_id from " . DB_PREFIX . "youhui_log where id = " . $youhui_log_id));
     } else {
         $youhui_id = intval($_REQUEST['youhui_id']);
     }
     if ($event_submit_id > 0) {
         $event_id = intval($GLOBALS['db']->getOne("select event_id from " . DB_PREFIX . "event_submit where id = " . $event_submit_id));
     } else {
         $event_id = intval($_REQUEST['event_id']);
     }
     $location_id = intval($_REQUEST['location_id']);
     if ($deal_id > 0) {
         require_once APP_ROOT_PATH . "system/model/deal.php";
         $deal_info = get_deal($deal_id);
         if ($deal_info) {
             //验证是否可以点评
             $checker = check_dp_status($GLOBALS['user_info']['id'], array("deal_id" => $deal_id, "order_item_id" => $order_item_id));
             if (!$checker['status']) {
                 showErr($checker['info'], 0, $deal_info['url']);
             }
             $dp_data = load_dp_info(array("deal_id" => $deal_id));
             if ($deal_info['is_shop'] == 1) {
                 $dp_cfg = load_dp_cfg(array("scate_id" => $deal_info['shop_cate_id']));
             } else {
                 $dp_cfg = load_dp_cfg(array("cate_id" => $deal_info['cate_id']));
             }
             $item_info['id'] = $deal_info['id'];
             $item_info['key'] = 'deal_id';
             $item_info['ex_key'] = 'order_item_id';
             $item_info['ex_id'] = $order_item_id;
             $item_info['name'] = $deal_info['sub_name'];
             $item_info['detail'] = $deal_info['name'];
             $item_info['url'] = $deal_info['url'];
             $item_info['image'] = $deal_info['icon'];
             $GLOBALS['tmpl']->assign("dp_data", $dp_data);
             $GLOBALS['tmpl']->assign("dp_cfg", $dp_cfg);
             $GLOBALS['tmpl']->assign("item_info", $item_info);
             //print_r($dp_cfg);
             //输出导航
             $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => url("index"));
             $site_nav[] = array('name' => $deal_info['sub_name'], 'url' => url("index", "review", array("deal_id" => $deal_info['id'])));
             $GLOBALS['tmpl']->assign("site_nav", $site_nav);
             //输出seo
             $page_title = "";
             $page_keyword = "";
             $page_description = "";
             if ($deal_info['supplier_info']['name']) {
                 $page_title .= "[" . $deal_info['supplier_info']['name'] . "]";
                 $page_keyword .= $deal_info['supplier_info']['name'] . ",";
                 $page_description .= $deal_info['supplier_info']['name'] . ",";
             }
             $page_title .= $deal_info['sub_name'];
             $page_keyword .= $deal_info['sub_name'];
             $page_description .= $deal_info['sub_name'];
             $GLOBALS['tmpl']->assign("page_title", $page_title);
             $GLOBALS['tmpl']->assign("page_keyword", $page_keyword);
             $GLOBALS['tmpl']->assign("page_description", $page_description);
             //输出右侧的其他团购
             if ($deal_info['is_shop'] == 0) {
                 $side_deal_list = get_deal_list(5, array(DEAL_ONLINE, DEAL_NOTICE), array("cid" => $deal_info['cate_id'], "city_id" => $GLOBALS['city']['id']), "", "  d.buy_type <> 1 and d.is_shop = 0 and d.id<>" . $deal_info['id']);
             } elseif ($deal_info['is_shop'] == 1) {
                 if ($deal_info['buy_type'] == 1) {
                     $side_deal_list = get_goods_list(5, array(DEAL_ONLINE, DEAL_NOTICE), array("cid" => $deal_info['shop_cate_id'], "city_id" => $GLOBALS['city']['id']), "", "  d.buy_type = 1 and d.is_shop = 1 and d.id<>" . $deal_info['id']);
                 } else {
                     $side_deal_list = get_goods_list(5, array(DEAL_ONLINE, DEAL_NOTICE), array("cid" => $deal_info['shop_cate_id'], "city_id" => $GLOBALS['city']['id']), "", "  d.buy_type <> 1 and d.is_shop = 1 and d.id<>" . $deal_info['id']);
                 }
             }
             //$side_deal_list = get_deal_list(4,array(DEAL_ONLINE));
             $GLOBALS['tmpl']->assign("side_deal_list", $side_deal_list['list']);
         } else {
             showErr("你要点评的商品不存在");
         }
     } elseif ($youhui_id > 0) {
         require_once APP_ROOT_PATH . "system/model/youhui.php";
         $youhui_info = get_youhui($youhui_id);
         if ($youhui_info) {
             //验证是否可以点评
             $checker = check_dp_status($GLOBALS['user_info']['id'], array("youhui_id" => $youhui_id, "youhui_log_id" => $youhui_log_id));
             if (!$checker['status']) {
//.........这里部分代码省略.........
开发者ID:macall,项目名称:jsd,代码行数:101,代码来源:reviewModule.class.php

示例14: index

 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("wrap_type", "1");
     //宽屏展示
     require_once APP_ROOT_PATH . "system/model/deal.php";
     //浏览历史
     $history_ids = get_view_history("shop");
     //浏览历史
     if ($history_ids) {
         $ids_conditioin = " d.id in (" . implode(",", $history_ids) . ") ";
         $history_deal_list = get_goods_list(app_conf("SIDE_DEAL_COUNT"), array(DEAL_ONLINE), array("city_id" => $GLOBALS['city']['id']), "", $ids_conditioin);
         //重新组装排序
         $history_list = array();
         foreach ($history_ids as $k => $v) {
             foreach ($history_deal_list['list'] as $history_item) {
                 if ($history_item['id'] == $v) {
                     $history_list[] = $history_item;
                 }
             }
         }
         $GLOBALS['tmpl']->assign("history_deal_list", $history_list);
     }
     //参数处理
     $shop_cate_id = intval($_REQUEST['cid']);
     if ($shop_cate_id) {
         $url_param['cid'] = $shop_cate_id;
     }
     $brand_id = intval($_REQUEST['bid']);
     if ($brand_id) {
         $url_param['bid'] = intval($_REQUEST['bid']);
     }
     foreach ($_REQUEST as $k => $v) {
         if (preg_match("/fid_(\\d+)/i", $k, $matches)) {
             $url_param[$matches[0]] = strim($v);
         }
     }
     $sort_name = strim($_REQUEST["sort"]);
     if ($sort_name != "current_price" && $sort_name != "buy_count") {
         $sort_name = "";
     }
     if ($sort_name) {
         $url_param['sort'] = $sort_name;
     }
     $sort_type = strim($_REQUEST['type']) == "asc" ? "asc" : "desc";
     if ($_REQUEST['type']) {
         $url_param['type'] = $sort_type;
     }
     $dtag = intval($_REQUEST['dtag']);
     if ($dtag) {
         $url_param['dtag'] = $dtag;
     }
     $pr = intval($_REQUEST['pr']);
     //价格阶梯序号
     if ($pr) {
         $url_param['pr'] = $pr;
     }
     if ($GLOBALS['kw']) {
         $url_param['kw'] = $GLOBALS['kw'];
     }
     //条件初始化
     $condition = " buy_type <> 1 and is_shop = 1 ";
     //商品且不为积分商品
     //seo元素
     $page_title = "商城";
     $page_keyword = "商城";
     $page_description = "商城";
     //输出自定义的filter_row
     /* array(
     				"nav_list"=>array(
     						array( //导航类型的切换
     							"current"=>array("name"=>'xxx',"url"=>"当前的地址","cancel"=>"取消的地址"),
     							"list"=>array(
     									array("name"=>"xxx","url"=>"xxx")
     								)
     						)
     				),
     				"filter_list"=>array( //列表类型的切换
     					array(
     						"name"=>"分类",
     						"list"	=> array(
     								array("name"=>"xxx","url"=>"xxx")
     						)
     					)		
     				)
     			
     		); */
     $cate_cache = load_auto_cache("cache_shop_cate");
     //商城分类缓存
     //获取品牌
     if ($shop_cate_id > 0) {
         $cate_key = load_auto_cache("shop_cate_key", array("cid" => $shop_cate_id));
         $brand_list = $GLOBALS['db']->getAll("select id,name from " . DB_PREFIX . "brand where match(tag_match) against('" . $cate_key . "' IN BOOLEAN MODE)  order by sort limit 100");
         if ($brand_id > 0 && $brand_list) {
             $brand_info = $GLOBALS['db']->getRow("select id,name from " . DB_PREFIX . "brand where id = " . $brand_id);
         }
     }
     if ($shop_cate_id > 0 && $cate_cache[$shop_cate_id] || $brand_id > 0 && $brand_list) {
         $filter_row_data['nav_list'][] = array("current" => array("name" => "全部", "url" => url("index", "cate")));
//.........这里部分代码省略.........
开发者ID:macall,项目名称:jsd,代码行数:101,代码来源:cateModule.class.php

示例15: index

 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $page = intval($GLOBALS['request']['page']);
     $cates = intval($GLOBALS['request']['cates']);
     $integral = intval($GLOBALS['request']['integral']);
     $sort = intval($GLOBALS['request']['sort']);
     //检查用户,用户密码
     //		$user = user_check($email,$pwd);
     //		$user_id  = intval($user['id']);
     //		if ($user_id >0){
     require APP_ROOT_PATH . 'app/Lib/deal.php';
     $root['user_login_status'] = 1;
     $root['response_code'] = 1;
     //输出投标列表
     //$page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("DEAL_PAGE_SIZE") . "," . app_conf("DEAL_PAGE_SIZE");
     $condition = " 1=1";
     if ($sort == 1) {
         $condition .= " AND is_new = 1";
     } elseif ($sort == 2) {
         $condition .= " AND is_hot = 1 ";
     } elseif ($sort == 3) {
         $orderby = " score desc";
     }
     if ($cates > 0) {
         $cates_id = $GLOBALS['db']->getAll("select id from " . DB_PREFIX . "goods_cate where pid = " . $cates);
         $flatmap = array_map("array_pop", $cates_id);
         $cates_ids = implode(',', $flatmap);
         if ($cates_ids == "") {
             $condition .= " AND cate_id in (" . $cates . ") ";
         } else {
             $condition .= " AND cate_id in (" . $cates . "," . $cates_ids . ") ";
         }
     }
     if ($integral == 0) {
         $condition .= "";
     } elseif ($integral == 1) {
         $condition .= " AND score  <= 500";
     } elseif ($integral == 2) {
         $condition .= " AND score  between 500 and 1000";
     } elseif ($integral == 3) {
         $condition .= " AND score  between 1000 and 3000";
     } elseif ($integral == 4) {
         $condition .= " AND score  between 3000 and 5000";
     } else {
         $condition .= " AND score  >= 5000";
     }
     //商品列表
     $goods_list = get_goods_list($limit, $condition, $orderby);
     foreach ($goods_list as $k => $v) {
         //$root['goods_img'] = SITE_DOMAIN/$v['img'];
         //$root['goods_img'] = str_replace(".","",$v['img']);
         $root['goods_img'] = $v['img'];
     }
     $root['goods_list'] = $goods_list['list'];
     $root['page'] = array("page" => $page, "page_total" => ceil($goods_list['count'] / app_conf("DEAL_PAGE_SIZE")), "page_size" => app_conf("DEAL_PAGE_SIZE"));
     $page_args['cates'] = $cates;
     $page_args['integral'] = $integral;
     $page_args['sort'] = $sort;
     //商品类别
     $cates_urls = load_auto_cache("score_cates");
     $cates_url = array();
     $cates_url[0]['id'] = 0;
     $cates_url[0]['name'] = "不限";
     $tmp_args = $page_args;
     $tmp_args['cates'] = 0;
     $cates_url[0]['url'] = url("index", "score#index", $tmp_args);
     foreach ($cates_urls as $k => $v) {
         $cates_url[$k + 1]['id'] = $v['id'];
         $cates_url[$k + 1]['name'] = $v['name'];
         $tmp_args = $page_args;
         $tmp_args['cates'] = $v['id'];
         $cates_url[$k + 1]['url'] = url("index", "score#index", $tmp_args);
     }
     $root['cates_url'] = $cates_url;
     //积分范围
     $integral_url = array(array("id" => 0, "name" => "不限"), array("id" => 1, "name" => "500积分以下"), array("id" => 2, "name" => "500-1000积分"), array("id" => 3, "name" => "1000-3000积分"), array("id" => 4, "name" => "3000-5000积分"), array("id" => 5, "name" => "5000积分以上"));
     foreach ($integral_url as $k => $v) {
         $tmp_args = $page_args;
         $tmp_args['integral'] = $k;
         $integral_url[$k]['url'] = url("index", "score#index", $tmp_args);
     }
     $root['integral_url'] = $integral_url;
     $sort_url = array(array("id" => 0, "name" => "默认排序"), array("id" => 1, "name" => "最新"), array("id" => 2, "name" => "热门"), array("id" => 3, "name" => "积分"));
     foreach ($sort_url as $k => $v) {
         $tmp_args = $page_args;
         $tmp_args['sort'] = $k;
         $sort_url[$k]['url'] = url("index", "score#index", $tmp_args);
     }
     $root['sort_url'] = $sort_url;
     $cates = intval($GLOBALS['request']['cates']);
     $root['cates'] = $cates;
//.........这里部分代码省略.........
开发者ID:eliu03,项目名称:fanweP2P,代码行数:101,代码来源:integral_mall.action.php


注:本文中的get_goods_list函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。