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


PHP get_category_recommend_goods函数代码示例

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


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

示例1: get_categories_tree_supplier

    $smarty->assign('categories', get_categories_tree_supplier());
    // 分类树
    $smarty->display('../dianpu1/supplier_catalog.dwt');
    exit;
}
//判断是否有ajax请求
$act = !empty($_GET['act']) ? $_GET['act'] : '';
if ($act == 'cat_rec') {
    $rec_array = array(1 => 'best', 2 => 'new', 3 => 'hot');
    $rec_type = !empty($_REQUEST['rec_type']) ? intval($_REQUEST['rec_type']) : '1';
    $cat_id = !empty($_REQUEST['cid']) ? intval($_REQUEST['cid']) : '0';
    include_once 'includes/cls_json.php';
    $json = new JSON();
    $result = array('error' => 0, 'content' => '', 'type' => $rec_type, 'cat_id' => $cat_id);
    $children = get_children($cat_id);
    $smarty->assign($rec_array[$rec_type] . '_goods', get_category_recommend_goods($rec_array[$rec_type], $children));
    // 推荐商品
    $smarty->assign('cat_rec_sign', 1);
    $result['content'] = $smarty->fetch('library/recommend_' . $rec_array[$rec_type] . '.lbi');
    die($json->encode($result));
}
/*------------------------------------------------------ */
//-- 判断是否存在缓存,如果存在则调用缓存,反之读取相应内容
/*------------------------------------------------------ */
/* 缓存编号 */
$cache_id = sprintf('%X', crc32($_SESSION['user_rank'] . '-' . $_CFG['lang'] . '-' . $_GET['suppId']));
if (!$smarty->is_cached('mall.dwt', $cache_id)) {
    //echo "<pre>";
    //print_r($_CFG);
    assign_template();
    assign_template_supplier();
开发者ID:moonlight-wang,项目名称:feilun,代码行数:31,代码来源:supplier_catalog.php

示例2: assign_pager

    $smarty->assign('script_name', 'category');
    assign_pager('category', $cat_id, $count, $size, $sort, $order, $page, '', $brand, $price_min, $price_max, $display, $filter_attr_str);
    // 分页
    assign_dynamic('category');
    // 动态内容
}
/* 获得所有的图片 */
foreach ($goodslist as $key => $goods) {
    $good_id = $goods['goods_id'];
    $sql = 'SELECT img_id, img_desc, thumb_url, middle_url, img_url' . ' FROM ' . $ecs->table('goods_gallery') . " WHERE goods_id = '{$good_id}' ORDER BY img_id";
    $img_list = $db->getAll($sql);
    $goodslist[$key]["img_list"] = $img_list;
}
$smarty->assign('goods_list', $goodslist);
$smarty->assign("cate", $cate[$cat_id][cat_id]);
$good_hot = get_category_recommend_goods('hot', $children, $brand, $price_min, $price_max, $ext);
foreach ($good_hot as $key => $gh) {
    $good_id = $gh['id'];
    $sql = 'SELECT img_id, img_desc, thumb_url, middle_url, img_url' . ' FROM ' . $ecs->table('goods_gallery') . " WHERE goods_id = '{$good_id}' ORDER BY img_id";
    $img_list = $db->getAll($sql);
    $good_hot[$key]["img_list"] = $img_list;
}
$smarty->assign('hot_goods', $good_hot);
//echo "<pre>";
//print_r($good_hot);
$smarty->display('list.dwt', $cache_id);
/*------------------------------------------------------ */
//-- PRIVATE FUNCTION
/*------------------------------------------------------ */
/**
 * 获得分类的信息
开发者ID:Richerjx,项目名称:ecshop,代码行数:31,代码来源:category.php

示例3: array

     $arr = array();
 }
 $brand_list = array_merge($arr, get_brands($cat_id, 'category'));
 $smarty->assign('data_dir', DATA_DIR);
 $smarty->assign('brand_list', $brand_list);
 $smarty->assign('promotion_info', get_promotion_info('', 0));
 /* 调查 */
 $vote = get_vote();
 if (!empty($vote)) {
     $smarty->assign('vote_id', $vote['id']);
     $smarty->assign('vote', $vote['content']);
 }
 $smarty->assign('best_goods', get_category_recommend_goods('best', $children, $brand, $price_min, $price_max, $ext));
 $smarty->assign('promotion_goods', get_category_recommend_goods('promote', $children, $brand, $price_min, $price_max, $ext));
 $smarty->assign('hot_goods', get_category_recommend_goods('hot', $children, $brand, $price_min, $price_max, $ext));
 $smarty->assign('new_goods', get_category_recommend_goods('new', $children, $brand, $price_min, $price_max, $ext));
 $count = get_cagtegory_goods_count($children, $brand, $price_min, $price_max, $ext);
 $max_page = $count > 0 ? ceil($count / $size) : 1;
 if ($page > $max_page) {
     $page = $max_page;
 }
 $goodslist = category_get_goods($children, $brand, $price_min, $price_max, $ext, $size, $page, $sort, $order);
 if ($display == 'grid') {
     if (count($goodslist) % 2 != 0) {
         $goodslist[] = array();
     }
 }
 $smarty->assign('goods_list', $goodslist);
 $smarty->assign('category', $cat_id);
 $smarty->assign('script_name', 'category');
 $smarty->assign('cat_name_curr', $cat['cat_name']);
开发者ID:seanguo166,项目名称:yinoos,代码行数:31,代码来源:category.php

示例4: array

    if($display == 'grid')
    {
        if(count($arr) % 2 != 0)
        {
            $arr[] = array();
        }
    }
    $smarty->assign('goods_list', $arr);
    $smarty->assign('category',   $category);
    $smarty->assign('keywords',   htmlspecialchars(stripslashes($_REQUEST['keywords'])));
    $smarty->assign('search_keywords',   stripslashes(htmlspecialchars_decode($_REQUEST['keywords'])));
    $smarty->assign('brand',      $_REQUEST['brand']);
    $smarty->assign('min_price',  $min_price);
    $smarty->assign('max_price',  $max_price);
    $smarty->assign('outstock',  $_REQUEST['outstock']);
	$smarty->assign('promotion_goods', get_category_recommend_goods('promote', $dwt_name, $children, $brand, $price_min, $price_max, $ext));

    /* 分页 */
    $url_format = "search.php?category=$category&amp;keywords=" . urlencode(stripslashes($_REQUEST['keywords'])) . "&amp;brand=" . $_REQUEST['brand']."&amp;action=".$action."&amp;goods_type=" . $_REQUEST['goods_type'] . "&amp;sc_ds=" . $_REQUEST['sc_ds'];
    if (!empty($intromode))
    {
        $url_format .= "&amp;intro=" . $intromode;
    }
    if (isset($_REQUEST['pickout']))
    {
        $url_format .= '&amp;pickout=1';
    }
    $url_format .= "&amp;min_price=" . $_REQUEST['min_price'] ."&amp;max_price=" . $_REQUEST['max_price'] . "&amp;sort=$sort";

    $url_format .= "$attr_url&amp;order=$order&amp;page=";
开发者ID:blowfishJ,项目名称:galaxyCode,代码行数:30,代码来源:search.php


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