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


PHP get_volume_price_list函数代码示例

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


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

示例1: get_final_price

/**
 * 取得商品最终使用价格
 *
 * @param   string  $goods_id      商品编号
 * @param   string  $goods_num     购买数量
 * @param   boolean $is_spec_price 是否加入规格价格
 * @param   mix     $spec          规格ID的数组或者逗号分隔的字符串
 *
 * @return  商品最终购买价格
 */
function get_final_price($goods_id, $goods_num = '1', $is_spec_price = false, $spec = array())
{
    $final_price = '0';
    //商品最终购买价格
    $volume_price = '0';
    //商品优惠价格
    $promote_price = '0';
    //商品促销价格
    $user_price = '0';
    //商品会员价格
    //取得商品优惠价格列表
    $price_list = get_volume_price_list($goods_id, '1');
    if (!empty($price_list)) {
        foreach ($price_list as $value) {
            if ($goods_num >= $value['number']) {
                $volume_price = $value['price'];
            }
        }
    }
    //取得商品促销价格列表
    /* 取得商品信息 */
    $sql = "SELECT g.promote_price, g.promote_start_date, g.promote_end_date, " . "IFNULL(mp.user_price, g.shop_price * '" . $_SESSION['discount'] . "') AS shop_price " . " FROM " . $GLOBALS['ecs']->table('goods') . " AS g " . " LEFT JOIN " . $GLOBALS['ecs']->table('member_price') . " AS mp " . "ON mp.goods_id = g.goods_id AND mp.user_rank = '" . $_SESSION['user_rank'] . "' " . " WHERE g.goods_id = '" . $goods_id . "'" . " AND g.is_delete = 0";
    $goods = $GLOBALS['db']->getRow($sql);
    /* 计算商品的促销价格 */
    if ($goods['promote_price'] > 0) {
        $promote_price = bargain_price($goods['promote_price'], $goods['promote_start_date'], $goods['promote_end_date']);
    } else {
        $promote_price = 0;
    }
    //取得商品会员价格列表
    $user_price = $goods['shop_price'];
    //比较商品的促销价格,会员价格,优惠价格
    if (empty($volume_price) && empty($promote_price)) {
        //如果优惠价格,促销价格都为空则取会员价格
        $final_price = $user_price;
    } elseif (!empty($volume_price) && empty($promote_price)) {
        //如果优惠价格为空时不参加这个比较。
        $final_price = min($volume_price, $user_price);
    } elseif (empty($volume_price) && !empty($promote_price)) {
        //如果促销价格为空时不参加这个比较。
        $final_price = min($promote_price, $user_price);
    } elseif (!empty($volume_price) && !empty($promote_price)) {
        //取促销价格,会员价格,优惠价格最小值
        $final_price = min($volume_price, $promote_price, $user_price);
    } else {
        $final_price = $user_price;
    }
    //如果需要加入规格价格
    if ($is_spec_price) {
        if (!empty($spec)) {
            $spec_price = spec_price($spec);
            $final_price += $spec_price;
        }
    }
    //返回商品最终购买价格
    return $final_price;
}
开发者ID:YangZeSummer,项目名称:NanJingSecond-Hand,代码行数:67,代码来源:lib_common.php

示例2: get_member_price_list

    $smarty->assign('user_rank_list', $user_rank_list);
    if (!$is_add) {
        $smarty->assign('member_price_list', get_member_price_list($_REQUEST['goods_id']));
    }
    $smarty->assign('link_goods_list', $link_goods_list);
    $smarty->assign('group_goods_list', $group_goods_list);
    $smarty->assign('goods_article_list', $goods_article_list);
    $smarty->assign('img_list', img_list($img_list));
    $smarty->assign('goods_type_list', goods_type_list($goods['goods_type']));
    $smarty->assign('gd', gd_version());
    $smarty->assign('thumb_width', $_CFG['thumb_width']);
    $smarty->assign('thumb_height', $_CFG['thumb_height']);
    $smarty->assign('goods_attr_html', build_attr_html($goods['goods_type'], $goods['goods_id']));
    $volume_price_list = '';
    if (isset($_REQUEST['goods_id'])) {
        $volume_price_list = get_volume_price_list($_REQUEST['goods_id']);
    }
    if (empty($volume_price_list)) {
        $volume_price_list = array('0' => array('number' => '', 'price' => ''));
    }
    $smarty->assign('volume_price_list', $volume_price_list);
    /* 显示商品信息页面 */
    assign_query_info();
    $smarty->display('goods_info.htm');
} elseif ($_REQUEST['act'] == 'insert' || $_REQUEST['act'] == 'update' || $_REQUEST['act'] == 'special_update') {
    //dump($_POST['rank_start_num']);
    $code = empty($_REQUEST['extension_code']) ? '' : trim($_REQUEST['extension_code']);
    //dump($_POST);
    /* 是否处理缩略图 */
    $proc_thumb = isset($GLOBALS['shop_id']) && $GLOBALS['shop_id'] > 0 ? false : true;
    if ($code == 'virtual_card') {
开发者ID:dlpc,项目名称:ecshop,代码行数:31,代码来源:goods.php

示例3: get_promotion_info

     //这里是 参加活动的 商品属性 ross
     $activity_best[] = get_promotion_info($rs_goodsid2[$i]);
     //array_pop($activity_best);
     $rs_price2['format_price'] = end($b)['format_price'];
     $rs_goods_best[$i]['format_price'] = $rs_price2['format_price'];
     if ($activity_best[$i][0]['act_name'] == null) {
         continue;
     }
     $rs_goods_best[$i]['act_name'] = $rs_str . substr($activity_best[$i][0]['act_name'], 12);
 }
 //var_dump($rs_goods_best);
 $rs_goodsid3 = array();
 $rs_price3 = array();
 for ($i = 0; $i < count($rs_goods_hot); ++$i) {
     $rs_goodsid3[] = $rs_goods_hot[$i]['id'];
     $c = get_volume_price_list($rs_goodsid3[$i], '1');
     //这里是 参加活动的 商品属性 ross
     $activity_hot[] = get_promotion_info($rs_goodsid[$i]);
     $rs_price3['format_price'] = end($c)['format_price'];
     $rs_goods_hot[$i]['format_price'] = $rs_price3['format_price'];
     if ($activity_hot[$i][0]['act_name'] == null) {
         continue;
     }
     $rs_goods_hot[$i]['act_name'] = $rs_str . substr($activity_hot[$i][0]['act_name'], 12);
 }
 //var_dump($rs_goods_hot);
 $new_goods = $rs_goods_new;
 $best_goods = $rs_goods_best;
 $hot_goods = $rs_goods_hot;
 //$hot_goods = $rs_goods_hot;
 /* .end ross  */
开发者ID:jinjiang2009,项目名称:exiao_online,代码行数:31,代码来源:index.php

示例4: get_top10

 $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");
 $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'] = $db->getOne("SELECT COUNT(*) AS num FROM " . $ecs->table('comment') . " WHERE id_value = '{$goods_id}' AND status = 1 AND FIND_IN_SET({$v['tag_id']},comment_tag)");
开发者ID:seanguo166,项目名称:yinoos,代码行数:31,代码来源:pro_goods.php

示例5: get_category_recommend_goods

    $smarty->assign('hot_goods', get_category_recommend_goods('hot', $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();
        }
    }
    /* 修改价格*/
    $k = array();
    foreach ($goodslist as $key => $val) {
        $end_price = get_volume_price_list($key, '1');
        $end_price2[$key] = end($end_price);
        $goodslist[$key]['format_price'] = $end_price2[$key]['format_price'];
    }
    /* 修改价格*/
    $smarty->assign('goods_list', $goodslist);
    $smarty->assign('category', $cat_id);
    $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');
    // 动态内容
}
$smarty->display('category.dwt', $cache_id);
/*------------------------------------------------------ */
//-- PRIVATE FUNCTION
开发者ID:jinjiang2009,项目名称:exiao_online,代码行数:31,代码来源:category.php


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