本文整理汇总了PHP中get_recommend_goods函数的典型用法代码示例。如果您正苦于以下问题:PHP get_recommend_goods函数的具体用法?PHP get_recommend_goods怎么用?PHP get_recommend_goods使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_recommend_goods函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_user_center
/**
* 用户中心显示
*/
function show_user_center()
{
$best_goods = get_recommend_goods('best');
if (count($best_goods) > 0) {
foreach ($best_goods as $key => $best_data) {
$best_goods[$key]['shop_price'] = encode_output($best_data['shop_price']);
$best_goods[$key]['name'] = encode_output($best_data['name']);
}
}
$GLOBALS['smarty']->assign('best_goods', $best_goods);
$GLOBALS['smarty']->display('user.wml');
}
示例2: define
/**
* ECSHOP WAP首页
* ============================================================================
* 版权所有 2005-2008 上海商派网络科技有限公司,并保留所有权利。
* 网站地址: http://www.ecshop.com;
* ----------------------------------------------------------------------------
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
* 使用;不允许对程序代码以任何形式任何目的的再发布。
* ============================================================================
* $Author: testyang $
* $Id: index.php 15013 2008-10-23 09:31:42Z testyang $
*/
define('IN_ECS', true);
define('ECS_ADMIN', true);
require dirname(__FILE__) . '/includes/init.php';
$best_goods = get_recommend_goods('best');
$best_num = count($best_goods);
$smarty->assign('best_num', $best_num);
if ($best_num > 0) {
$i = 0;
foreach ($best_goods as $key => $best_data) {
$best_goods[$key]['shop_price'] = encode_output($best_data['shop_price']);
$best_goods[$key]['name'] = encode_output($best_data['name']);
/*if ($i > 2)
{
break;
}*/
$i++;
}
$smarty->assign('best_goods', $best_goods);
}
示例3: get_goods_properties
// 页面标题
$smarty->assign('ur_here', $position['ur_here']);
// 当前位置
$properties = get_goods_properties($goods_id);
// 获得商品的规格和属性
$smarty->assign('properties', $properties['pro']);
// 商品属性
$smarty->assign('specification', $properties['spe']);
// 商品规格
$smarty->assign('attribute_linked', get_same_attribute_goods($properties));
// 相同属性的关联商品
$smarty->assign('related_goods', $linked_goods);
// 关联商品
$smarty->assign('goods_article_list', get_linked_articles($goods_id));
// 关联文章
$smarty->assign('recommend_goods', get_recommend_goods('hot'));
//获得相关推荐商品
$smarty->assign('fittings', get_goods_fittings(array($goods_id)));
// 配件
$smarty->assign('rank_prices', get_user_rank_prices($goods_id, $shop_price));
// 会员等级价格
$smarty->assign('pictures', get_goods_gallery($goods_id));
// 商品相册
//$smarty->assign('bought_goods', get_also_bought($goods_id)); // 购买了该商品的用户还购买了哪些商品
//$smarty->assign('goods_rank', get_goods_rank($goods_id)); // 商品的销售排名
//$smarty->assign('related_cat', get_related_cat($goods['cat_id']));
//$smarty->assign('related_brand', get_related_brand($goods['cat_id']));
//$smarty->assign('top10_brand', get_top10_brand($goods['brand_id']));
//$smarty->assign('top10_category', get_top10($goods['cat_id']));
//$smarty->assign('top10_price', get_top10_price($goods['shop_price']));
//by mike start
示例4: foreach
$smarty->assign('hot_num', $hot_num);
if ($hot_num > 0) {
$i = 0;
foreach ($hot_goods as $key => $hot_data) {
$hot_goods[$key]['shop_price'] = encode_output($hot_data['shop_price']);
$hot_goods[$key]['name'] = encode_output($hot_data['name']);
/*if ($i > 2)
{
break;
}*/
$i++;
}
$smarty->assign('hot_goods', $hot_goods);
}
/* 最新商品 */
$new_goods = get_recommend_goods('new');
$new_num = count($new_goods);
$smarty->assign('new_num', $new_num);
if ($new_num > 0) {
$i = 0;
foreach ($new_goods as $key => $new_data) {
$new_goods[$key]['shop_price'] = encode_output($new_data['shop_price']);
$new_goods[$key]['name'] = encode_output($new_data['name']);
/*if ($i > 2)
{
break;
}*/
$i++;
}
$smarty->assign('new_goods', $new_goods);
}
示例5: define
* 网站地址: http://www.ecshop.com;
* ----------------------------------------------------------------------------
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
* 使用;不允许对程序代码以任何形式任何目的的再发布。
* ============================================================================
* $Author: liubo $
* $Id: goods_list.php 17217 2011-01-19 06:29:08Z liubo $
*/
define('IN_ECS', true);
require dirname(__FILE__) . '/includes/init.php';
$type = !empty($_GET['type']) ? $_GET['type'] : 'best';
if ($type != 'best' && $type != 'promote' && $type != 'hot' && $type != 'new') {
$type = 'best';
}
$smarty->assign('type', $type);
$goods = get_recommend_goods($type);
$num = count($goods);
if ($num > 0) {
foreach ($goods as $key => $data) {
$sort_array[$data['id']] = $key;
}
krsort($sort_array);
$page_num = '10';
$page = !empty($_GET['page']) ? intval($_GET['page']) : 1;
$pages = ceil($num / $page_num);
if ($page <= 0) {
$page = 1;
}
if ($pages == 0) {
$pages = 1;
}
示例6: foreach
$smarty->assign('best_num', $best_num);
if ($best_num > 0) {
$i = 0;
foreach ($best_goods as $key => $best_data) {
$best_goods[$key]['shop_price'] = encode_output($best_data['shop_price']);
$best_goods[$key]['name'] = encode_output($best_data['name']);
/*if ($i > 2)
{
break;
}*/
$i++;
}
$smarty->assign('best_goods', $best_goods);
}
/* 热门商品 */
$hot_goods = get_recommend_goods('hot');
$hot_num = count($hot_goods);
$smarty->assign('hot_num', $hot_num);
if ($hot_num > 0) {
$i = 0;
foreach ($hot_goods as $key => $hot_data) {
$hot_goods[$key]['shop_price'] = encode_output($hot_data['shop_price']);
$hot_goods[$key]['name'] = encode_output($hot_data['name']);
/*if ($i > 2)
{
break;
}*/
$i++;
}
$smarty->assign('hot_goods', $hot_goods);
}
示例7: get_linked_articles
// 关联商品
$smarty->assign('goods_article_list', get_linked_articles($goods_id));
// 关联文章
$smarty->assign('fittings', get_goods_fittings(array($goods_id)));
// 配件
$smarty->assign('rank_prices', get_user_rank_prices($goods_id, $shop_price));
// 会员等级价格
$smarty->assign('pictures', get_goods_gallery_attr_www_ecshop68_com($goods_id, $goods_attr_id));
// 商品相册_修改 By www.ecshop68.com
$smarty->assign('new_goods', get_recommend_goods('new'));
// 最新商品 改 By www.ecshop68.com
$smarty->assign('bought_goods', get_also_bought($goods_id));
// 购买了该商品的用户还购买了哪些商品
$smarty->assign('goods_rank', get_goods_rank($goods_id));
// 商品的销售排名
$smarty->assign('best_goods', get_recommend_goods('best', $goods['supplier_id']));
// 最新商品
//yyy添加start
$count1 = $GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('comment') . " where comment_type=0 and id_value ='{$goods_id}' and status=1");
$smarty->assign('review_count', $count1);
//yyy添加end名
//获取tag
$tag_array = get_tags($goods_id);
$smarty->assign('tags', $tag_array);
// 商品的标记
if ($goods['is_buy'] == 1) {
if ($goods['buymax_start_date'] < gmtime() && $goods['buymax_end_date'] > gmtime()) {
if ($goods['buymax'] > 0) {
$tag = 1;
} else {
$tag = 0;
示例8: show_user_center
/**
* 用户中心显示
*/
function show_user_center()
{
include_once ROOT_PATH . 'includes/lib_clips.php';
$best_goods = get_recommend_goods('best');
if (count($best_goods) > 0) {
foreach ($best_goods as $key => $best_data) {
$best_goods[$key]['shop_price'] = encode_output($best_data['shop_price']);
$best_goods[$key]['name'] = encode_output($best_data['name']);
}
}
//22:18 2013-7-16
$rank_name = $GLOBALS['db']->getOne('SELECT rank_name FROM ' . $GLOBALS['ecs']->table('user_rank') . ' WHERE rank_id = ' . $_SESSION['user_rank']);
$GLOBALS['smarty']->assign('info', get_user_default($_SESSION['user_id']));
$GLOBALS['smarty']->assign('rank_name', $rank_name);
$GLOBALS['smarty']->assign('user_info', get_user_info());
$GLOBALS['smarty']->assign('best_goods', $best_goods);
$GLOBALS['smarty']->assign('footer', get_footer());
$GLOBALS['smarty']->display('user.dwt');
}
示例9: htmlspecialchars
$smarty->assign('keywords', htmlspecialchars($_CFG['shop_keywords']));
$smarty->assign('description', htmlspecialchars($_CFG['shop_desc']));
$smarty->assign('flash_theme', $_CFG['flash_theme']);
// Flash轮播图片模板
$smarty->assign('feed_url', $_CFG['rewrite'] == 1 ? 'feed.xml' : 'feed.php');
// RSS URL
$smarty->assign('categories', get_categories_tree());
// 分类树
$smarty->assign('helps', get_shop_help());
// 网店帮助
$smarty->assign('top_goods', get_top10());
// 销售排行
/*ross*/
$rs_goods_new = get_recommend_goods('new');
$rs_goods_best = get_recommend_goods('best');
$rs_goods_hot = get_recommend_goods('hot');
$activity_new = array();
$activity_best = array();
$activity_hot = array();
$rs_goodsid = array();
$rs_price = array();
$rs_str = '<b class="rs_cuxiao">促销</b> ';
for ($i = 0; $i < count($rs_goods_new); ++$i) {
$rs_goodsid[] = $rs_goods_new[$i]['id'];
$a = get_volume_price_list($rs_goodsid[$i], '1');
//这里是 参加活动的 商品属性 ross
$activity_new[] = get_promotion_info($rs_goodsid[$i]);
$rs_price['format_price'] = end($a)['format_price'];
$rs_goods_new[$i]['format_price'] = $rs_price['format_price'];
if ($activity_new[$i][0]['act_name'] == null) {
continue;
示例10: getGoods
function getGoods($type)
{
return get_recommend_goods($type);
}
示例11: assign_template
//-- INPUT
/*------------------------------------------------------ */
if (!isset($_REQUEST['step'])) {
$_REQUEST['step'] = "cart";
}
/*------------------------------------------------------ */
//-- PROCESSOR
/*------------------------------------------------------ */
assign_template();
assign_dynamic('flow');
$position = assign_ur_here(0, $_LANG['shopping_flow']);
$smarty->assign('page_title', $position['title']);
// 页面标题
$smarty->assign('ur_here', $position['ur_here']);
// 当前位置
$smarty->assign('new_goods', get_recommend_goods('new'));
// 最新商品
$smarty->assign('categories', get_categories_tree());
// 分类树
$smarty->assign('helps', get_shop_help());
// 网店帮助
$smarty->assign('lang', $_LANG);
$smarty->assign('show_marketprice', $_CFG['show_marketprice']);
$smarty->assign('data_dir', DATA_DIR);
// 数据目录
/*------------------------------------------------------ */
//-- 添加商品到购物车
/*------------------------------------------------------ */
if ($_REQUEST['step'] == 'add_to_cart') {
include_once 'includes/cls_json.php';
$_POST['goods'] = strip_tags(urldecode($_POST['goods']));
示例12: htmlspecialchars
$smarty->assign('page_title', $position['title']);
// 页面标题
$smarty->assign('ur_here', $position['ur_here']);
// 当前位置
/* meta information */
$smarty->assign('keywords', htmlspecialchars($_CFG['shop_keywords']));
$smarty->assign('description', htmlspecialchars($_CFG['shop_desc']));
$smarty->assign('flash_theme', $_CFG['flash_theme']);
// Flash轮播图片模板
$smarty->assign('feed_url', $_CFG['rewrite'] == 1 ? 'feed.xml' : 'feed.php');
// RSS URL
//$smarty->assign('categories', get_categories_tree()); // 分类树
$smarty->assign('helps', get_shop_help());
// 网店帮助
//$smarty->assign('top_goods', get_top10()); // 销售排行
$smarty->assign('best_goods', get_recommend_goods('best'));
// 推荐商品
//print_r(get_recommend_goods('best'));exit;
//$smarty->assign('new_goods', get_recommend_goods('new')); // 最新商品
//$smarty->assign('hot_goods', get_recommend_goods('hot')); // 天天狂赚
//$smarty->assign('promotion_goods', get_promote_goods()); // 特价商品
//$smarty->assign('brand_list', get_brands());
//$smarty->assign('promotion_info', get_promotion_info()); // 增加一个动态显示所有促销信息的标签栏
//$smarty->assign('invoice_list', index_get_invoice_query()); // 发货查询
$smarty->assign('new_articles', index_get_new_articles());
// 最新公告
$smarty->assign('new_amount', index_get_new_amount());
// 最新动态
//$smarty->assign('group_buy_goods', index_get_group_buy()); // 团购商品
//$smarty->assign('auction_list', index_get_auction()); // 拍卖活动
//$smarty->assign('shop_notice', $_CFG['shop_notice']); // 商店公告
示例13: action_view
//.........这里部分代码省略.........
// $goods['child_cat'] = get_child_cat($parent_cat_id); // 相关分类
// $goods['get_cat_brands'] = get_cat_brands($parent_cat_id);; // 同类品牌
$smarty->assign('url', $_SERVER["REQUEST_URI"]);
$smarty->assign('volume_price', $goods_volume_price);
$smarty->assign('goods_id', $goods['goods_id']);
$smarty->assign('promote_end_time', $goods['gmt_end_time']);
$smarty->assign('helps', get_shop_help());
// 网店帮助
$smarty->assign('top_goods', get_top10());
// 销售排行
$smarty->assign('promotion_info', get_promotion_info());
// yyy添加start
$count1 = $GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('comment') . " where comment_type=0 and id_value ='{$goods_id}' and status=1");
$smarty->assign('review_count', $count1);
// 评论数
// 评价晒单 增加 by www.68ecshop.com
$rank_num['rank_a'] = $GLOBALS['db']->getOne("SELECT COUNT(*) AS num FROM " . $GLOBALS['ecs']->table('comment') . " WHERE id_value = '{$goods_id}' AND status = 1 AND comment_rank in (5,4)");
$rank_num['rank_b'] = $GLOBALS['db']->getOne("SELECT COUNT(*) AS num FROM " . $GLOBALS['ecs']->table('comment') . " WHERE id_value = '{$goods_id}' AND status = 1 AND comment_rank in (3,2)");
$rank_num['rank_c'] = $GLOBALS['db']->getOne("SELECT COUNT(*) AS num FROM " . $GLOBALS['ecs']->table('comment') . " WHERE id_value = '{$goods_id}' AND status = 1 AND comment_rank = 1");
$rank_num['rank_total'] = $rank_num['rank_a'] + $rank_num['rank_b'] + $rank_num['rank_c'];
$rank_num['rank_pa'] = $rank_num['rank_a'] > 0 ? round($rank_num['rank_a'] / $rank_num['rank_total'] * 100, 1) : 0;
$rank_num['rank_pb'] = $rank_num['rank_b'] > 0 ? round($rank_num['rank_b'] / $rank_num['rank_total'] * 100, 1) : 0;
$rank_num['rank_pc'] = $rank_num['rank_c'] > 0 ? round($rank_num['rank_c'] / $rank_num['rank_total'] * 100, 1) : 0;
$rank_num['shaidan_num'] = $GLOBALS['db']->getOne("SELECT COUNT(*) AS num FROM " . $GLOBALS['ecs']->table('shaidan') . " WHERE goods_id = '{$goods_id}' AND status = 1");
$smarty->assign('rank_num', $rank_num);
$res = $GLOBALS['db']->getAll("SELECT * FROM " . $GLOBALS['ecs']->table('goods_tag') . " WHERE goods_id = '{$goods_id}' AND state = 1");
foreach ($res as $v) {
$v['tag_num'] = $GLOBALS['db']->getOne("SELECT COUNT(*) AS num FROM " . $GLOBALS['ecs']->table('comment') . " WHERE id_value = '{$goods_id}' AND status = 1 AND FIND_IN_SET({$v['tag_id']},comment_tag)");
$tag_arr[] = $v;
}
require_once 'includes/lib_comment.php';
$tag_arr = array_sort($tag_arr, 'tag_num', 'desc');
if ($tag_arr) {
foreach ($tag_arr as $key => $val) {
if ($_CFG['tag_show_num'] > 0) {
if ($key + 1 <= $_CFG['tag_show_num']) {
$comment_tags[] = $val;
}
} else {
$comment_tags[] = $val;
}
}
}
$smarty->assign('comment_tags', $comment_tags);
/* meta */
$smarty->assign('keywords', htmlspecialchars($goods['keywords']));
$smarty->assign('description', htmlspecialchars($goods['goods_brief']));
$goods['goods_style_name'] = add_style($goods['goods_name'], $goods['goods_name_style']);
$smarty->assign('goods', $goods);
$smarty->assign('goods_id', $goods['goods_id']);
/* 取得商品的规格 */
$properties = get_goods_properties($goods_id);
$smarty->assign('specification', $properties['spe']);
// 商品规格
$smarty->assign('pictures', get_goods_gallery_attr_2($goods_id, $goods_attr_id));
// 商品相册
$smarty->assign('new_goods', get_recommend_goods('new'));
// 最新商品
$smarty->assign('shop_country', $_CFG['shop_country']);
/* 代码增加_start By www.ecshop68.com */
$sql_attr = "SELECT a.attr_id, ga.goods_attr_id FROM " . $GLOBALS['ecs']->table('attribute') . " AS a left join " . $GLOBALS['ecs']->table('goods_attr') . " AS ga on a.attr_id=ga.attr_id WHERE a.is_attr_gallery=1 and ga.goods_id='" . $goods_id . "' order by ga.goods_attr_id ";
$goods_attr = $GLOBALS['db']->getRow($sql_attr);
if ($goods_attr) {
$goods_attr_id = $goods_attr['goods_attr_id'];
$smarty->assign('attr_id', $goods_attr['attr_id']);
} else {
$smarty->assign('attr_id', 0);
}
$prod_exist_arr = array();
$sql_prod = "select goods_attr from " . $GLOBALS['ecs']->table('products') . " where product_number>0 and goods_id='{$goods_id}' order by goods_attr";
$res_prod = $GLOBALS['db']->query($sql_prod);
while ($row_prod = $GLOBALS['db']->fetchRow($res_prod)) {
$prod_exist_arr[] = "|" . $row_prod['goods_attr'] . "|";
}
$smarty->assign('prod_exist_arr', $prod_exist_arr);
// 模板赋值
$smarty->assign('cfg', $_CFG);
assign_template();
$position = assign_ur_here(0, $goods['goods_name']);
$smarty->assign('page_title', $position['title']);
// 页面标题
$smarty->assign('ur_here', $position['ur_here']);
// 当前位置
/* 代码增加_start By www.68ecshop.com */
$goods['supplier_name'] = "网站自营";
if ($goods['supplier_id'] > 0) {
$sql_supplier = "SELECT s.supplier_id,s.supplier_name,s.add_time,sr.rank_name FROM " . $ecs->table("supplier") . " as s left join " . $ecs->table("supplier_rank") . " as sr ON s.rank_id=sr.rank_id WHERE s.supplier_id=" . $goods[supplier_id] . " AND s.status=1";
$shopuserinfo = $db->getRow($sql_supplier);
$goods['supplier_name'] = $shopuserinfo['supplier_name'];
get_dianpu_baseinfo($goods['supplier_id'], $shopuserinfo);
}
assign_dynamic('pre_sale_goods');
}
// 更新商品点击次数
$sql = 'UPDATE ' . $GLOBALS['ecs']->table('goods') . ' SET click_count = click_count + 1 ' . "WHERE goods_id = '" . $pre_sale['goods_id'] . "'";
$GLOBALS['db']->query($sql);
$smarty->assign('now_time', gmtime());
// 当前系统时间
$smarty->display('pre_sale_goods.dwt', $cache_id);
}
示例14: get_categories_tree
$smarty->assign('intromode', $intromode);
$smarty->assign('categories', get_categories_tree());
// 分类树
/*ccx 2014-12-20 代理商只显示自己的商品导航 开始*/
//if(agency_id() != 345 ) //大学城代理商
//{
$smarty->assign('categories_pro', get_categories_tree_pro());
// 分类树加强版
//}
$smarty->assign('agency_id', agency_id());
/*ccx 2014-12-20 代理商只显示自己的商品导航 结束*/
$smarty->assign('helps', get_shop_help());
// 网店帮助
$smarty->assign('top_goods', get_top10());
// 销售排行
foreach (get_recommend_goods('hot') as $v => $k) {
unset($k['market_price']);
$array[$v] = $k;
}
//dump($_CFG);
$smarty->assign('hot_goods', $array);
// 热卖商品
$smarty->assign('promotion_info', get_promotion_info());
$smarty->display('search.dwt');
}
/*------------------------------------------------------ */
//-- PRIVATE FUNCTION
/*------------------------------------------------------ */
/**
*
*