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


PHP get_goods_specifications_list函数代码示例

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


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

示例1: make_json_error

     make_json_error($_LANG['sys']['wrong'] . $_LANG['cannot_found_goods']);
 } else {
     $goods_id = intval($_REQUEST['goods_id']);
 }
 /* 取出商品信息 */
 $sql = "SELECT goods_sn, goods_name, goods_type, shop_price FROM " . $ecs->table('goods') . " WHERE goods_id = '{$goods_id}'";
 $goods = $db->getRow($sql);
 if (empty($goods)) {
     make_json_error($_LANG['sys']['wrong'] . $_LANG['cannot_found_goods']);
 }
 $smarty->assign('sn', sprintf($_LANG['good_goods_sn'], $goods['goods_sn']));
 $smarty->assign('price', sprintf($_LANG['good_shop_price'], $goods['shop_price']));
 $smarty->assign('goods_name', sprintf($_LANG['products_title'], $goods['goods_name']));
 $smarty->assign('goods_sn', sprintf($_LANG['products_title_2'], $goods['goods_sn']));
 /* 获取商品规格列表 */
 $attribute = get_goods_specifications_list($goods_id);
 if (empty($attribute)) {
     make_json_error($_LANG['sys']['wrong'] . $_LANG['cannot_found_goods']);
 }
 foreach ($attribute as $attribute_value) {
     //转换成数组
     $_attribute[$attribute_value['attr_id']]['attr_values'][] = $attribute_value['attr_value'];
     $_attribute[$attribute_value['attr_id']]['attr_id'] = $attribute_value['attr_id'];
     $_attribute[$attribute_value['attr_id']]['attr_name'] = $attribute_value['attr_name'];
 }
 $attribute_count = count($_attribute);
 $smarty->assign('attribute_count', $attribute_count);
 $smarty->assign('attribute', $_attribute);
 $smarty->assign('attribute_count_3', $attribute_count + 3);
 $smarty->assign('product_sn', $goods['goods_sn'] . '_');
 $smarty->assign('product_number', $_CFG['default_storage']);
开发者ID:dlpc,项目名称:ecshop,代码行数:31,代码来源:goods.php

示例2: array

 } else {
     /* 商品信息 */
     $sql = 'SELECT * FROM ' . $ecs->table('goods') . " WHERE goods_id = '{$_REQUEST['goods_id']}'";
     $goods = $db->getRow($sql);
     /* 虚拟卡商品复制时, 将其库存置为0*/
     if ($is_copy && $code != '') {
         $goods['goods_number'] = 0;
     }
     if (empty($goods) === true) {
         /* 默认值 */
         $goods = array('goods_id' => 0, 'goods_desc' => '', 'cat_id' => 0, 'is_on_sale' => '1', 'is_alone_sale' => '1', 'is_shipping' => '0', 'other_cat' => array(), 'goods_type' => 0, 'shop_price' => 0, 'promote_price' => 0, 'market_price' => 0, 'integral' => 0, 'goods_number' => 1, 'warn_number' => 1, 'promote_start_date' => local_date('Y-m-d'), 'goods_weight' => 0, 'give_integral' => -1, 'rank_integral' => -1, 'shelflife' => 24, 'per_number' => 100, 'every_num' => 3, 'everyday_use' => 3, 'per_number_units' => '粒', 'every_num_units' => '粒');
     }
     /* 获取商品类型存在规格的类型 */
     $specifications = get_goods_type_specifications();
     $goods['specifications_id'] = $specifications[$goods['goods_type']];
     $_attribute = get_goods_specifications_list($goods['goods_id']);
     $goods['_attribute'] = empty($_attribute) ? '' : 1;
     /* 根据商品重量的单位重新计算 */
     if ($goods['goods_weight'] > 0) {
         $goods['goods_weight_by_unit'] = $goods['goods_weight'] >= 1 ? $goods['goods_weight'] : $goods['goods_weight'] / 0.001;
     }
     if (!empty($goods['goods_brief'])) {
         $goods['goods_brief'] = trim_right($goods['goods_brief']);
         $goods['goods_brief'] = $goods['goods_brief'];
     }
     if (!empty($goods['keywords'])) {
         $goods['keywords'] = trim_right($goods['keywords']);
         $goods['keywords'] = $goods['keywords'];
     }
     /* 如果不是促销,处理促销日期 */
     if (isset($goods['is_promote']) && $goods['is_promote'] == '0') {
开发者ID:554119220,项目名称:kjrscrm,代码行数:31,代码来源:goods.php


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