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


PHP get_package_goods_list函数代码示例

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


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

示例1: get_order_goods

/**
 * 取得订单商品
 * @param   array     $order  订单数组
 * @return array
 */
function get_order_goods($order)
{
    $goods_list = array();
    $goods_attr = array();
    $sql = "SELECT o.*, g.suppliers_id AS suppliers_id,IF(o.product_id > 0, p.product_number, g.goods_number) AS storage, o.goods_attr, IFNULL(b.brand_name, '') AS brand_name, p.product_sn " . "FROM " . $GLOBALS['ecs']->table('order_goods') . " AS o " . "LEFT JOIN " . $GLOBALS['ecs']->table('products') . " AS p ON o.product_id = p.product_id " . "LEFT JOIN " . $GLOBALS['ecs']->table('goods') . " AS g ON o.goods_id = g.goods_id " . "LEFT JOIN " . $GLOBALS['ecs']->table('brand') . " AS b ON g.brand_id = b.brand_id " . "WHERE o.order_id = '{$order['order_id']}' ";
    $res = $GLOBALS['db']->query($sql);
    while ($row = $GLOBALS['db']->fetchRow($res)) {
        // 虚拟商品支持
        if ($row['is_real'] == 0) {
            /* 取得语言项 */
            $filename = ROOT_PATH . 'plugins/' . $row['extension_code'] . '/languages/common_' . $GLOBALS['_CFG']['lang'] . '.php';
            if (file_exists($filename)) {
                include_once $filename;
                if (!empty($GLOBALS['_LANG'][$row['extension_code'] . '_link'])) {
                    $row['goods_name'] = $row['goods_name'] . sprintf($GLOBALS['_LANG'][$row['extension_code'] . '_link'], $row['goods_id'], $order['order_sn']);
                }
            }
        }
        $row['formated_subtotal'] = price_format($row['goods_price'] * $row['goods_number']);
        $row['formated_goods_price'] = price_format($row['goods_price']);
        $goods_attr[] = explode(' ', trim($row['goods_attr']));
        //将商品属性拆分为一个数组
        if ($row['extension_code'] == 'package_buy') {
            $row['storage'] = '';
            $row['brand_name'] = '';
            $row['package_goods_list'] = get_package_goods_list($row['goods_id']);
        }
        //处理货品id
        $row['product_id'] = empty($row['product_id']) ? 0 : $row['product_id'];
        $goods_list[] = $row;
    }
    $attr = array();
    $arr = array();
    foreach ($goods_attr as $index => $array_val) {
        foreach ($array_val as $value) {
            $arr = explode(':', $value);
            //以 : 号将属性拆开
            $attr[$index][] = @array('name' => $arr[0], 'value' => $arr[1]);
        }
    }
    return array('goods_list' => $goods_list, 'attr' => $attr);
}
开发者ID:norain2050,项目名称:benhu,代码行数:47,代码来源:order.php

示例2: get_goods_rank

 $smarty->assign('goods_rank', get_goods_rank($goods_id));
 // 商品的销售排
 $smarty->assign('promotion_goods', get_promote_goods_group());
 // 特价商品
 $smarty->assign('top_goods', get_top10());
 // 销售排行
 //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);
 // 商品的标记
 //获取关联礼包
 $package_goods_list = get_package_goods_list($goods['goods_id']);
 $smarty->assign('package_goods_list', $package_goods_list);
 // 获取关联礼包
 assign_dynamic('goods');
 $volume_price_list = get_volume_price_list($goods['goods_id'], '1');
 $smarty->assign('volume_price_list', $volume_price_list);
 // 商品优惠价格区间
 //评价晒单 增加 by www.68ecshop.com
 $rank_num['rank_a'] = $db->getOne("SELECT COUNT(*) AS num FROM " . $ecs->table('comment') . " WHERE id_value = '{$goods_id}' AND status = 1 AND comment_rank in (5,4)");
 $rank_num['rank_b'] = $db->getOne("SELECT COUNT(*) AS num FROM " . $ecs->table('comment') . " WHERE id_value = '{$goods_id}' AND status = 1 AND comment_rank in (3,2)");
 $rank_num['rank_c'] = $db->getOne("SELECT COUNT(*) AS num FROM " . $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'] = $db->getOne("SELECT COUNT(*) AS num FROM " . $ecs->table('shaidan') . " WHERE goods_id = '{$goods_id}' AND status = 1");
开发者ID:seanguo166,项目名称:yinoos,代码行数:31,代码来源:pro_goods.php


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