zoukankan      html  css  js  c++  java
  • ECShop笔记(一)

    /*获得指定分类同级的所有分类以及该分类下的子分类*/

    get_categories_tree($cat_id = 0)   获取商品分类树数组(多维)。

    array(3) {
    [1] => array(4) {
    ["id"] => string(1) "1"
    ["name"] => string(12) "手机类型"
    ["url"] => string(17) "category.php?id=1"
    ["cat_id"] => array(4) {
    [2] => array(4) {
    ["id"] => string(1) "2"
    ["name"] => string(10) "CDMA手机"
    ["url"] => string(17) "category.php?id=2"
    ["cat_id"] => array(0) {
    }
    }
    [3] => array(4) {
    ["id"] => string(1) "3"
    ["name"] => string(9) "GSM手机"
    ["url"] => string(17) "category.php?id=3"
    ["cat_id"] => array(0) {
    }
    }
    }
    }

    /*获得指定分类下的子分类数组*/

    get_child_tree($tree_id = 0)   (多维)

    array(4) {
    [7] => array(4) {
    ["id"] => string(1) "7"
    ["name"] => string(9) "充电器"
    ["url"] => string(17) "category.php?id=7"
    ["cat_id"] => array(0) {
    }
    }
    [8] => array(4) {
    ["id"] => string(1) "8"
    ["name"] => string(6) "耳机"
    ["url"] => string(17) "category.php?id=8"
    ["cat_id"] => array(0) {
    }
    }
    }

    /**
    * 获得分类的信息
    * @position exchange.php
    * @param   integer $cat_id
    *
    * @return  void
    */
    get_cat_info($cat_id)

    array(6) {
      ["keywords"] => string(0) ""
      ["cat_desc"] => string(0) ""
      ["style"] => string(0) ""
      ["grade"] => string(1) "4"
      ["filter_attr"] => string(15) "185,189,173,178"
      ["parent_id"] => string(1) "1"
    }

    /**
    * 获取销售排行榜
    * @position lib_custom.php
    * @access  public
    * @param   num  $time   查询的时间范围,单位为天
    * @param   num  $limit   数量
    * @param   string  $cats   查询的分类id,支持多个分类,以逗号分隔,如 '2,7,6'
    * @return  array
    */

    get_sale_rank($time=7,$limit=10,$cats = '')

    /**
    * 调用当前分类的销售排行榜
    * @position lib_goods.php
    * @access  public
    * @param   string  $cats   查询的分类id,支持多个分类,以逗号分隔,如 '2,7,6'

    * @return  array
    */

    get_top10($cats = '') : 获取指定分类下商品的销售排行数组(二维)。

    [0] => array(9) {

            ["goods_id"] => string(1) "3"

            ["goods_name"] => string(25) "诺基亚原装5800耳机"

            ["shop_price"] => string(5) "68.00"

            ["goods_thumb"] => string(51) "images/200905/thumb_img/3_thumb_G_1241422082679.jpg"

            ["goods_number"] => string(1) "4" ["short_name"] => string(20) "诺基亚原装58..."

            ["url"] => string(14) "goods.php?id=3"

            ["thumb"] => string(51) "images/200905/thumb_img/3_thumb_G_1241422082679.jpg"

            ["price"] => string(8) "¥68元"

    }

    get_promotion_info():获取所有的促销信息数组(二维)

    array(2) {
    [0] => array(5) {
    ["act_name"] => string(4) "P806"
    ["url"] => string(31) "group_buy.php?act=view&id=8"
    ["time"] => string(56) "的时间为2009-05-15到2011-01-30,赶快来抢吧!"
    ["sort"] => string(10) "1242316800"
    ["type"] => string(9) "group_buy"
    }
    [1] => array(5) {
    ["act_name"] => string(23) "夺宝奇兵之夏新N7"
    ["url"] => string(15) "snatch.php?id=2"
    ["time"] => string(56) "的时间为2009-05-12到2011-10-20,赶快来抢吧!"
    ["sort"] => string(10) "1242107820"
    ["type"] => string(6) "snatch"
    }
    }
     

    index_get_invoice_query()  发货信息数组(二维)

    array(2) {
    [0] => array(3) {
    ["order_sn"] => string(13) "2009061909851"
    ["invoice_no"] => string(6) "232421"
    ["shipping_code"] => string(12) "city_express"
    }
    [1] => array(3) {
    ["order_sn"] => string(13) "2009052224892"
    ["invoice_no"] => string(7) "1123344"
    ["shipping_code"] => string(12) "city_express"
    }
    }
     

    get_vote() 投票内容数组

    array(2) {
    ["id"] => string(1) "1"
    ["content"] => array(1) {
    [1] => array(5) {
    ["options"] => array(3) {
    [3] => array(4) {
    ["percent"] => float(100)
    ["option_id"] => string(1) "3"
    ["option_name"] => string(12) "友情链接"
    ["option_count"] => string(1) "1"
    }
    [2] => array(4) {
    ["percent"] => float(0)
    ["option_id"] => string(1) "2"
    ["option_name"] => string(6) "朋友"
    ["option_count"] => string(1) "0"
    }
    [1] => array(4) {
    ["percent"] => float(0)
    ["option_id"] => string(1) "1"
    ["option_name"] => string(6) "论坛"
    ["option_count"] => string(1) "0"
    }
    }
    ["vote_id"] => string(1) "1"
    ["vote_name"] => string(33) "您从哪里知道我们的网站"
    ["can_multi"] => string(1) "0"
    ["vote_count"] => string(1) "1"
    }
    }
    }

    get_promote_goods()  特价商品数组(二维)

    array(1) {
    [0] => array(13) {
    ["promote_price"] => string(10) "¥2750元"
    ["id"] => string(2) "32"
    ["name"] => string(12) "诺基亚N85"
    ["brief"] => string(0) ""
    ["brand_name"] => string(9) "诺基亚"
    ["goods_style_name"] => string(12) "诺基亚N85"
    ["short_name"] => string(12) "诺基亚N85"
    ["short_style_name"] => string(12) "诺基亚N85"
    ["market_price"] => string(10) "¥3612元"
    ["shop_price"] => string(10) "¥3010元"
    ["thumb"] => string(52) "images/200905/thumb_img/32_thumb_G_1242110760196.jpg"
    ["goods_img"] => string(46) "images/200905/goods_img/32_G_1242110760868.jpg"
    ["url"] => string(15) "goods.php?id=32"
    }
    }

    /**
    * 取得优惠活动信息
    * @param   int     $act_id     活动id  即 ecs_goods_activity 中的act_id
    * @return  array
    */

    favourable_info($act_id) 

    array(15) {
    ["act_id"] => string(1) "1"
    ["act_name"] => string(24) "5.1诺基亚优惠活动"
    ["start_time"] => string(19) "2009-05-01 08:00:00"
    ["end_time"] => string(19) "2011-01-31 08:00:00"
    ["user_rank"] => string(3) "1,2"
    ["act_range"] => string(1) "2"
    ["act_range_ext"] => string(1) "1"
    ["min_amount"] => string(6) "500.00"
    ["max_amount"] => string(7) "5000.00"
    ["act_type"] => string(1) "2"
    ["act_type_ext"] => string(5) "95.00"
    ["gift"] => array(0) {
    }
    ["sort_order"] => string(2) "50"
    ["formated_min_amount"] => string(9) "¥500元"
    ["formated_max_amount"] => string(10) "¥5000元"
    }

    get_brands($cat = 0, $app = 'brand')  品牌数组(二维)只有存在商品的品牌才会包含进来

    array(10) {
    [0] => array(7) {
    ["brand_id"] => string(1) "1"
    ["brand_name"] => string(9) "诺基亚"
    ["brand_logo"] => string(23) "1240803062307572427.gif"
    ["brand_desc"] => string(68) "公司网站:http://www.nokia.com.cn/客服电话:400-880-0123"
    ["goods_num"] => string(1) "7"
    ["tag"] => string(1) "1"
    ["url"] => string(14) "brand.php?id=1"
    }

    }

    /**
    * 取得品牌列表
    * @return array  品牌列表 id => name
    */

    get_brand_list()

    array(2) {
    [1] => string(15) "太平洋家居"
    [2] => string(12) "新浪家居"
    }

    /*获取指定分类下的推荐商品*/

    get_recommend_goods($type = '', $cats = '')  推荐商品数组(二维),$type可以是 best, new, hot,这里$cat参数貌似没什么用,如:

    get_recommend_goods('best')  精品商品数组(二维)

    array(10) {
    [0] => array(13) {
    ["promote_price"] => string(0) ""
    ["id"] => string(1) "9"
    ["name"] => string(12) "诺基亚E66"
    ["brief"] => string(0) ""
    ["brand_name"] => string(9) "诺基亚"
    ["goods_style_name"] => string(12) "诺基亚E66"
    ["short_name"] => string(12) "诺基亚E66"
    ["short_style_name"] => string(12) "诺基亚E66"
    ["market_price"] => string(10) "¥2758元"
    ["shop_price"] => string(10) "¥2298元"
    ["thumb"] => string(51) "images/200905/thumb_img/9_thumb_G_1241511871555.jpg"
    ["goods_img"] => string(45) "images/200905/goods_img/9_G_1241511871574.jpg"
    ["url"] => string(14) "goods.php?id=9"
    }
    }
    类似的:

    get_recommend_goods('new') 新品商品数组(二维)

    get_recommend_goods('hot')  热销商品数组(二维)

    /**

    $type :推荐类型(String),best,new,hot,promote

    $cats:商品条件(String),改参数为字符串,所以很灵活,基本上就可以看做自定义条件,如值可以是 cat_id=8,更多条件可以参照数据表写出 ,

    $brand:商品所属品牌id

    $min:最低的商品价格

    $max:最高的商品价格

    */

    get_category_recommend_goods($type = '', $cats = '', $brand = 0, $min =0,  $max = 0, $ext='')

    /**
    * 获得指定条件下的推荐商品
    * @position lib_custom.php
    * @access  public
    * @param   string      $type       推荐类型,可以是 best, new, hot, promote
    * @param   string      $cats       商品条件(String),改参数为字符串,所以很灵活,基本上就可以看做自定义条件,如值可以是 cat_id=8,更多条件可以参照数据表写出 ,

    * @param   integer     $brand      品牌的ID
    * @param   integer     $min        商品价格下限
    * @param   integer     $max        商品价格上限
    * @param   string      $ext        商品扩展查询
    * @return  array
    */
    get_custom_recommend_goods($type = '',$limit = '', $cats = '', $brand = 0, $min =0,  $max = 0, $ext='')

    array(1) {
      [0] => array(12) {
        ["promote_price"] => string(8) "¥78元"
        ["id"] => string(1) "3"
        ["name"] => string(18) "尚高家用卫浴"
        ["brief"] => string(0) ""
        ["brand_name"] => string(12) "尚高卫浴"
        ["short_name"] => string(18) "尚高家用卫浴"
        ["market_price"] => string(8) "¥72元"
        ["shop_price"] => string(8) "¥60元"
        ["thumb"] => string(51) "images/201101/thumb_img/3_thumb_G_1295829459119.jpg"
        ["goods_img"] => string(45) "images/201101/goods_img/3_G_1295829459079.jpg"
        ["url"] => string(14) "goods.php?id=3"
        ["short_style_name"] => string(18) "尚高家用卫浴"
      }
    }

    /**
    * 获得指定商品分类的信息以及该分类下的商品
    * @position lib_custom.php
    * @access  public
    * @param   integer     $cat_id     分类ID
    * @param   integer     $num        商品数量
    * @param   string      $order_rule 指定商品排序规则
    * @return  array
    */
    get_cat_goods($cat_id, $num = 0, $order_rule = '')

    array(4) {
      ["goods"] => array(1) {
        [0] => array(10) {
          ["promote_price"] => string(0) ""
          ["id"] => string(1) "1"
          ["name"] => string(15) "格伦比尼床"
          ["brief"] => string(0) ""
          ["market_price"] => string(10) "¥1200元"
          ["short_name"] => string(15) "格伦比尼床"
          ["shop_price"] => string(10) "¥1000元"
          ["thumb"] => string(51) "images/201101/thumb_img/1_thumb_G_1295821762531.jpg"
          ["goods_img"] => string(45) "images/201101/goods_img/1_G_1295821762350.jpg"
          ["url"] => string(14) "goods.php?id=1"
        }
      }
      ["name"] => string(12) "家用电器"
      ["url"] => string(17) "category.php?id=8"
      ["id"] => int(8)
    }

    /**

    *position  goods.php

    *$good_id  商品id

    */

    get_goods_info($goods_id)   获取商品详细信息(一维)

    array(52) {
    ["goods_id"] => string(1) "9"
    ["cat_id"] => string(1) "3"
    ["goods_sn"] => string(9) "ECS000009"
    ["goods_name"] => string(12) "诺基亚E66"
    ["goods_name_style"] => string(1) "+"
    ["click_count"] => string(2) "20"
    ["brand_id"] => string(1) "1"
    ["provider_name"] => string(0) ""
    ["goods_number"] => string(1) "4"
    ["goods_weight"] => string(6) "121克"
    ["market_price"] => string(10) "¥2758元"
    ["shop_price"] => string(7) "2298.00"
    ["promote_price"] => string(7) "¥0元"
    ["promote_start_date"] => string(1) "0"
    ["promote_end_date"] => string(1) "0"
    ["warn_number"] => string(1) "1"
    ["keywords"] => string(120) "SMS EMS MMS 短消息群发 语音 阅读器 SMS,EMS,MMS,短消息群发语音合成信息阅读器 黑色 白色 滑盖"
    ["goods_brief"] => string(0) ""
    ["goods_desc"] => string(1099) "<p>在机身材质方面,诺基亚E66大量采用金属材质,刨光的金属表面光泽动人,背面的点状效果规则却又不失变化,时尚感总是在不经意间诠释出来,并被人们所感知。E66机身尺寸为<span style="color: rgb(255, 0, 0);"><span style="font-size: larger;"><strong>107.5&times;49.5&times;13.6毫米,重量为121克</strong></span></span>,滑盖的造型竟然比E71还要轻一些。</p>
    <p>&nbsp;</p>
    <div>诺基亚E66机身正面是<span style="color: rgb(255, 0, 0);"><span style="font-size: larger;"><strong>一块2.4英寸1600万色QVGA分辨率(240&times;320像素)液晶显示屏</strong></span></span>。屏幕上方拥有光线感应元件,能够自适应周 围环境光调节屏幕亮度;屏幕下方是方向功能键区。打开滑盖,可以看到传统的数字键盘,按键的大小、手感、间隔以及键程适中,手感非常舒适。</div>
    <div>&nbsp;</div>
    <div>诺基亚为E66配备了一颗320万像素自动对焦摄像头,带有LED 闪光灯,支持多种拍照尺寸选择。</div>
    <p>&nbsp;</p>"
    ["goods_thumb"] => string(51) "images/200905/thumb_img/9_thumb_G_1241511871555.jpg"
    ["goods_img"] => string(45) "images/200905/goods_img/9_G_1241511871574.jpg"
    ["original_img"] => string(46) "images/200905/source_img/9_G_1241511871550.jpg"
    ["is_real"] => string(1) "1"
    ["extension_code"] => string(0) ""
    ["is_on_sale"] => string(1) "1"
    ["is_alone_sale"] => string(1) "1"
    ["is_shipping"] => string(1) "0"
    ["integral"] => float(2200)
    ["add_time"] => string(10) "2009-05-06"
    ["sort_order"] => string(3) "100"
    ["is_delete"] => string(1) "0"
    ["is_best"] => string(1) "1"
    ["is_new"] => string(1) "1"
    ["is_hot"] => string(1) "1"
    ["is_promote"] => string(1) "0"
    ["bonus_type_id"] => string(1) "0"
    ["last_update"] => string(10) "1269589743"
    ["goods_type"] => string(1) "9"
    ["seller_note"] => string(0) ""
    ["give_integral"] => string(2) "-1"
    ["rank_integral"] => string(2) "-1"
    ["suppliers_id"] => NULL
    ["is_check"] => NULL
    ["measure_unit"] => string(3) "台"
    ["goods_brand"] => string(9) "诺基亚"
    ["bonus_money"] => int(0)
    ["comment_rank"] => int(5)
    ["rank_price"] => string(4) "2298"
    ["shop_price_formated"] => string(10) "¥2298元"
    ["watermark_img"] => string(13) "watermark_new"
    ["promote_price_org"] => int(0)
    ["gmt_end_time"] => int(0)
    }

    /**
    * 取得商品信息
    * @param   int     $goods_id   商品id
    * @return  array
    */

    goods_info($goods_id)

    array(44) {
    ["goods_id"] => string(2) "23"
    ["cat_id"] => string(1) "5"
    ["goods_sn"] => string(9) "ECS000023"
    ["goods_name"] => string(12) "诺基亚N96"
    ["goods_name_style"] => string(1) "+"
    ["click_count"] => string(2) "17"
    ["brand_id"] => string(1) "1"
    ["provider_name"] => string(0) ""
    ["goods_number"] => string(1) "8"
    ["goods_weight"] => string(4) "0克"
    ["market_price"] => string(7) "4440.00"
    ["shop_price"] => string(7) "3700.00"
    ["promote_price"] => string(4) "0.00"
    ["promote_start_date"] => string(1) "0"
    ["promote_end_date"] => string(1) "0"
    ["warn_number"] => string(1) "1"
    ["keywords"] => string(119) "500万摄像头 microSD 工程塑料 蓝牙 数码相机 内置游戏 滑盖 高档 2008年09月 320×240 像素 黑色"
    ["goods_brief"] => string(0) ""
    ["goods_desc"] => string(1491) "<p>诺基亚N96采用了<strong><font size="3" color="#ff0000">双向滑盖</font></strong>设计,机身整体呈灰黑色,沉稳、大气,机身材质采用了高强度的塑料材质,手机背面采用了抛光面板的设计风格。N96三维体积103*55*20mm,重量为125g。屏幕方面,诺基亚N96配备一块<strong><font size="3" color="#ff0000">2.8英寸</font></strong>的屏幕,支持<strong><font size="3" color="#ff0000">1670万色</font></strong>显示,分辨率达到QVGA(320&times;240)水准。</p>
    <p><img alt="" src="file:///C:/DOCUME~1/user/LOCALS~1/Temp/moz-screenshot.jpg" /></p>
    <p>&nbsp;</p>
    <p>&nbsp;<img src="http://img2.zol.com.cn/product/21/896/ceN6LBMCid3X6.jpg" alt="" /></p>
    <p>诺基亚N96设置有专门的<strong><font size="3" color="#ff0000">音乐播放键</font></strong>和标准的3.5毫米音频插口,支持多格式音乐播放。内置了<strong><font size="3" color="#ff0000">多媒体播放器</font></strong>,支持FM调频收音机等娱乐功能。N96手机支持<strong><font size="3" color="#ff0000">N-Gage游戏平台</font></strong>,内置包括<font size="3" color="#ff0000"><strong>《PinBall》完整版</strong></font>在内的四款N-Gage游戏,除了手机本身内置的游戏,还可以从N-Gage的网站下载或者购买最新的游戏,而且可以在论坛里和其他玩家一起讨论。</p>
    <p><img src="http://img2.zol.com.cn/product/21/898/cekkw57qJjSI.jpg" alt="" /></p>
    <p>&nbsp;</p>"
    ["goods_thumb"] => string(52) "images/200905/thumb_img/23_thumb_G_1241971556399.jpg"
    ["goods_img"] => string(46) "images/200905/goods_img/23_G_1241971556855.jpg"
    ["original_img"] => string(47) "images/200905/source_img/23_G_1241971556256.jpg"
    ["is_real"] => string(1) "1"
    ["extension_code"] => string(0) ""
    ["is_on_sale"] => string(1) "1"
    ["is_alone_sale"] => string(1) "1"
    ["is_shipping"] => string(1) "0"
    ["integral"] => string(2) "37"
    ["add_time"] => string(10) "1241971488"
    ["sort_order"] => string(3) "100"
    ["is_delete"] => string(1) "0"
    ["is_best"] => string(1) "1"
    ["is_new"] => string(1) "1"
    ["is_hot"] => string(1) "0"
    ["is_promote"] => string(1) "0"
    ["bonus_type_id"] => string(1) "0"
    ["last_update"] => string(10) "1269589078"
    ["goods_type"] => string(1) "9"
    ["seller_note"] => string(0) ""
    ["give_integral"] => string(2) "-1"
    ["rank_integral"] => string(2) "-1"
    ["suppliers_id"] => NULL
    ["is_check"] => NULL
    ["brand_name"] => string(9) "诺基亚"
    }
    /**
    * $goods_id  商品id
    */

    get_goods_properties($goods_id)   //获取商品的属性和规格

    array(3) {
    ["pro"] => array(1) {
    ["商品属性"] => array(1) {
    [178] => array(2) {
    ["name"] => string(12) "外观样式"
    ["value"] => string(6) "滑盖"
    }
    }
    }
    ["spe"] => array(1) {
    [185] => array(3) {
    ["attr_type"] => string(1) "1"
    ["name"] => string(6) "颜色"
    ["values"] => array(2) {
    [0] => array(4) {
    ["label"] => string(6) "白色"
    ["price"] => string(1) "0"
    ["format_price"] => string(10) "¥0.00元"
    ["id"] => string(3) "227"
    }
    [1] => array(4) {
    ["label"] => string(6) "黑色"
    ["price"] => string(2) "10"
    ["format_price"] => string(11) "¥10.00元"
    ["id"] => string(3) "226"
    }
    }
    }
    }
    ["lnk"] => array(1) {
    [178] => array(2) {
    ["name"] => string(12) "外观样式"
    ["value"] => string(6) "滑盖"
    }
    }
    }

    /**
    * 获得属性相同的商品
    *
    * @access  public
    * @param   array   $attr   // 一般为get_goods_properties的返回值 

    * @return  array
    */

    get_same_attribute_goods($attr获得相同属性的商品

    array(1) {
    [178] => array(2) {
    ["title"] => string(27) "相同外观样式的商品"
    ["goods"] => array(5) {
    [8] => array(8) {
    ["goods_id"] => string(1) "8"
    ["goods_name"] => string(13) "飞利浦9@9v"
    ["short_name"] => string(13) "飞利浦9@9v"
    ["goods_thumb"] => string(51) "images/200905/thumb_img/8_thumb_G_1241425513488.jpg"
    ["market_price"] => string(9) "¥479元"
    ["shop_price"] => string(9) "¥399元"
    ["promote_price"] => int(0)
    ["url"] => string(14) "goods.php?id=8"
    }
    [10] => array(8) {
    ["goods_id"] => string(2) "10"
    ["goods_name"] => string(11) "索爱C702c"
    ["short_name"] => string(11) "索爱C702c"
    ["goods_thumb"] => string(52) "images/200905/thumb_img/10_thumb_G_1242973436403.jpg"
    ["market_price"] => string(10) "¥1594元"
    ["shop_price"] => string(10) "¥1328元"
    ["promote_price"] => int(0)
    ["url"] => string(15) "goods.php?id=10"
    }
        }
    }
    }

    /**
    * 取得商品属性
    * @param   int     $goods_id   商品id
    * @return  array
    */

    get_goods_attr($goods_id)

    array(1) {
    [185] => array(3) {
    ["attr_id"] => string(3) "185"
    ["attr_name"] => string(6) "颜色"
    ["goods_attr_list"] => array(2) {
    [227] => string(6) "白色"
    [226] => string(6) "黑色"
    }
    }
    }

    /**
    * 获得指定商品的相册
    *
    * @access  public
    * @param   integer     $goods_id
    * @return  array
    */

    get_goods_gallery($goods_id)

    array(4) {
    [0] => array(4) {
    ["img_id"] => string(2) "10"
    ["img_url"] => string(45) "images/200905/goods_img/8_P_1241425513388.jpg"
    ["thumb_url"] => string(51) "images/200905/thumb_img/8_thumb_P_1241425513834.jpg"
    ["img_desc"] => string(0) ""
    }
    [1] => array(4) {
    ["img_id"] => string(2) "11"
    ["img_url"] => string(45) "images/200905/goods_img/8_P_1241425891781.JPG"
    ["thumb_url"] => string(51) "images/200905/thumb_img/8_thumb_P_1241425891460.jpg"
    ["img_desc"] => string(6) "正面"
    }
    [2] => array(4) {
    ["img_id"] => string(2) "12"
    ["img_url"] => string(45) "images/200905/goods_img/8_P_1241425891193.jpg"
    ["thumb_url"] => string(51) "images/200905/thumb_img/8_thumb_P_1241425892547.jpg"
    ["img_desc"] => string(6) "背面"
    }
    [3] => array(4) {
    ["img_id"] => string(2) "13"
    ["img_url"] => string(45) "images/200905/goods_img/8_P_1241425892941.JPG"
    ["thumb_url"] => string(51) "images/200905/thumb_img/8_thumb_P_1241425892356.jpg"
    ["img_desc"] => string(6) "侧面"
    }
    }

    /**
    * 获得指定分类下的商品,该函数返回的是分类信息,并不直接返回商品数组
    *
    * @access  public
    * @param   integer     $cat_id     分类ID
    * @param   integer     $num        数量
    * @param   string      $from       来自web/wap的调用
    * @param   string      $order_rule 指定商品排序规则
    * @return  array
    */

    assign_cat_goods($cat_id, $num = 0, $from = 'web', $order_rule = '')    该函数会把商品数组赋值给一个叫 'cat_goods_' . $cat_id 的模板变量

    array(3) {
    ["name"] => string(9) "GSM手机"
    ["url"] => string(17) "category.php?id=3"
    ["id"] => int(3)
    }

    /**
    * 获得指定的品牌下的商品
    *
    * @access  public
    * @param   integer     $brand_id       品牌的ID
    * @param   integer     $num            数量
    * @param   integer     $cat_id         分类编号
    * @param   string      $order_rule     指定商品排序规则
    * @return  void
    */

    assign_brand_goods($brand_id, $num = 0, $cat_id = 0,$order_rule = '')

    array(2) {
    ["brand"] => array(3) {
    ["id"] => int(1)
    ["name"] => string(9) "诺基亚"
    ["url"] => string(14) "brand.php?id=1"
    }
    ["goods"] => array(7) {
    [0] => array(10) {
    ["id"] => string(2) "32"
    ["name"] => string(12) "诺基亚N85"
    ["short_name"] => string(12) "诺基亚N85"
    ["market_price"] => string(10) "¥3612元"
    ["shop_price"] => string(10) "¥3010元"
    ["promote_price"] => string(0) ""
    ["brief"] => string(0) ""
    ["thumb"] => string(52) "images/200905/thumb_img/32_thumb_G_1242110760196.jpg"
    ["goods_img"] => string(46) "images/200905/goods_img/32_G_1242110760868.jpg"
    ["url"] => string(15) "goods.php?id=32"
    }
    [1] => array(10) {
    ["id"] => string(2) "23"
    ["name"] => string(12) "诺基亚N96"
    ["short_name"] => string(12) "诺基亚N96"
    ["market_price"] => string(10) "¥4440元"
    ["shop_price"] => string(10) "¥3700元"
    ["promote_price"] => string(0) ""
    ["brief"] => string(0) ""
    ["thumb"] => string(52) "images/200905/thumb_img/23_thumb_G_1241971556399.jpg"
    ["goods_img"] => string(46) "images/200905/goods_img/23_G_1241971556855.jpg"
    ["url"] => string(15) "goods.php?id=23"
    }
    [2] => array(10) {
    ["id"] => string(2) "14"
    ["name"] => string(15) "诺基亚5800XM"
    ["short_name"] => string(16) "诺基亚5800..."
    ["market_price"] => string(10) "¥3150元"
    ["shop_price"] => string(10) "¥2625元"
    ["promote_price"] => string(0) ""
    ["brief"] => string(0) ""
    ["thumb"] => string(52) "images/200905/thumb_img/14_thumb_G_1241968492116.jpg"
    ["goods_img"] => string(46) "images/200905/goods_img/14_G_1241968492932.jpg"
    ["url"] => string(15) "goods.php?id=14"
    }
      }
    }

    /**
    * 判断某个商品是否正在特价促销期
    *
    * @access  public
    * @param   float   $price      促销价格
    * @param   string  $start      促销开始日期
    * @param   string  $end        促销结束日期
    * @return  float   如果还在促销期则返回促销价,否则返回0
    */

    bargain_price($price, $start, $end)

    /**
    * 获得指定的规格的价格
    *
    * @access  public
    * @param   mix     $spec   规格ID的数组或者逗号分隔的字符串
    * @return  void
    */

    spec_price($spec)

    /**
    * 取得团购活动信息
    * @param   int     $group_buy_id   团购活动id  即 ecs_goods_activity 中的act_id,并且类型必须为团购
    * @param   int     $current_num    本次购买数量(计算当前价时要加上的数量)
    * @return  array
    *                  status          状态:
    */

    group_buy_info($group_buy_id, $current_num = 0)

    array(32) {
    ["act_id"] => string(1) "8"
    ["act_name"] => string(4) "P806"
    ["act_desc"] => string(13) "团购第2期"
    ["act_type"] => string(1) "1"
    ["goods_id"] => string(2) "24"
    ["product_id"] => string(1) "0"
    ["goods_name"] => string(4) "P806"
    ["start_time"] => string(16) "2009-05-15 08:00"
    ["end_time"] => string(16) "2011-01-31 08:00"
    ["is_finished"] => string(1) "0"
    ["ext_info"] => string(198) "a:4:{s:12:"price_ladder";a:2:{i:0;a:2:{s:6:"amount";i:5;s:5:"price";d:1910;}i:1;a:2:{s:6:"amount";i:10;s:5:"price";d:1860;}}s:15:"restrict_amount";i:0;s:13:"gift_integral";i:0;s:7:"deposit";d:1000;}"
    ["group_buy_id"] => string(1) "8"
    ["group_buy_desc"] => string(13) "团购第2期"
    ["start_date"] => string(10) "1242316800"
    ["end_date"] => string(10) "1296403200"
    ["price_ladder"] => array(2) {
    [0] => array(3) {
    ["amount"] => int(5)
    ["price"] => float(1910)
    ["formated_price"] => string(13) "¥1910.00元"
    }
    [1] => array(3) {
    ["amount"] => int(10)
    ["price"] => float(1860)
    ["formated_price"] => string(13) "¥1860.00元"
    }
    }
    ["restrict_amount"] => int(0)
    ["gift_integral"] => int(0)
    ["deposit"] => float(1000)
    ["formated_start_date"] => string(16) "2009-05-15 08:00"
    ["formated_end_date"] => string(16) "2011-01-31 08:00"
    ["formated_deposit"] => string(13) "¥1000.00元"
    ["total_order"] => string(1) "1"
    ["total_goods"] => string(1) "5"
    ["valid_order"] => string(1) "0"
    ["valid_goods"] => int(0)
    ["cur_price"] => float(1910)
    ["formated_cur_price"] => string(13) "¥1910.00元"
    ["trans_price"] => float(1910)
    ["formated_trans_price"] => string(13) "¥1910.00元"
    ["trans_amount"] => int(0)
    ["status"] => int(1)
    }
     

    /**
    * 取得某团购活动统计信息
    * @param   int     $group_buy_id   团购活动id  即 ecs_goods_activity 中的act_id,并且类型必须为团购
    * @param   float   $deposit        保证金
    * @return  array   统计信息
    *                  total_order     总订单数
    *                  total_goods     总商品数
    *                  valid_order     有效订单数
    *                  valid_goods     有效商品数
    */

    group_buy_stat($group_buy_id, $deposit)

    array(4) {
    ["total_order"] => string(1) "1"
    ["total_goods"] => string(1) "5"
    ["valid_order"] => string(1) "0"
    ["valid_goods"] => int(0)
    }

    /**
    * 获得团购的状态
    *
    * @access  public
    * @param   array,group_buy_info函数的返回值
    * @return  integer

    *  该函数返回的是 GBS_PRE_START,GBS_FINISHED,GBS_UNDER_WAY,GBS_FINISHED,GBS_SUCCEED,GBS_FAIL 定义的常量
    */

    group_buy_status($group_buy)  

    /**
    * 取得拍卖活动信息
    * @param   int     $act_id     活动id  即 ecs_goods_activity 中的act_id,并且类型必须为拍卖
    * @return  array
    */

    auction_info($act_id, $config = false)

    array(25) {
    ["act_id"] => string(1) "7"
    ["act_name"] => string(38) "拍卖活动——索爱C702c(第2期)"
    ["act_desc"] => string(49) "拍卖活动————索爱C702c (第2期)"
    ["act_type"] => string(1) "2"
    ["goods_id"] => string(2) "10"
    ["product_id"] => string(1) "0"
    ["goods_name"] => string(11) "索爱C702c"
    ["start_time"] => string(19) "2009-05-08 08:00:00"
    ["end_time"] => string(19) "2010-05-26 08:00:00"
    ["is_finished"] => string(1) "0"
    ["ext_info"] => string(106) "a:5:{s:7:"deposit";d:50;s:11:"start_price";d:0;s:9:"end_price";i:0;s:9:"amplitude";d:50;s:6:"no_top";i:1;}"
    ["status_no"] => int(2)
    ["deposit"] => float(50)
    ["start_price"] => float(0)
    ["end_price"] => int(0)
    ["amplitude"] => float(50)
    ["no_top"] => int(1)
    ["formated_start_price"] => string(7) "¥0元"
    ["formated_end_price"] => string(7) "¥0元"
    ["formated_amplitude"] => string(8) "¥50元"
    ["formated_deposit"] => string(8) "¥50元"
    ["bid_user_count"] => string(1) "0"
    ["order_count"] => string(1) "0"
    ["current_price"] => float(0)
    ["formated_current_price"] => string(10) "¥0.00元"
    }

    /**
    * 取得拍卖活动出价记录
    * @param   int     $act_id     活动id
    * @return  array
    */

    auction_log($act_id)

    /**
    * 计算拍卖活动状态(注意参数一定是原始信息)
    * @param   array   $auction    拍卖活动原始信息  即auction_info函数的返回值
    * @return  int  ,即拍卖状态的常量
    */

    auction_status($auction)

    /**
    * 批发信息
    * @param   int     $act_id     活动id  即 ecs_wholesale表中的 act_id
    * @return  array
    */

    wholesale_info($act_id)

    array(7) {
    ["act_id"] => string(1) "1"
    ["goods_id"] => string(2) "21"
    ["goods_name"] => string(10) "金立 A30"
    ["rank_ids"] => string(3) "1,2"
    ["prices"] => string(166) "a:1:{i:0;a:2:{s:4:"attr";a:1:{i:120;s:1:"0";}s:7:"qp_list";a:2:{i:0;a:2:{s:8:"quantity";i:50;s:5:"price";d:1700;}i:1;a:2:{s:8:"quantity";i:100;s:5:"price";d:1680;}}}}"
    ["enabled"] => string(1) "1"
    ["price_list"] => array(1) {
    [0] => array(2) {
    ["attr"] => array(1) {
    [120] => string(1) "0"
    }
    ["qp_list"] => array(2) {
    [0] => array(2) {
    ["quantity"] => int(50)
    ["price"] => float(1700)
    }
    [1] => array(2) {
    ["quantity"] => int(100)
    ["price"] => float(1680)
    }
    }
    }
    }
    }

    /**
    * 添加商品名样式
    * @param   string     $goods_name     商品名称
    * @param   string     $style          样式参数
    * @return  string
    */

    add_style($goods_name, $style)

    /**
    * 获得购物车中商品的配件
    *
    * @access  public
    * @param   array     $goods_list
    * @return  array
    */

    get_goods_fittings($goods_list = array())

    /**
    * 取指定规格的货品信息
    *
    * @access      public
    * @param       string      $goods_id
    * @param       array       $spec_goods_attr_id
    * @return      array
    */

    get_products_info($goods_id, $spec_goods_attr_id)

  • 相关阅读:
    trackr: An AngularJS app with a Java 8 backend – Part III
    trackr: An AngularJS app with a Java 8 backend – Part II
    21. Wireless tools (无线工具 5个)
    20. Web proxies (网页代理 4个)
    19. Rootkit detectors (隐形工具包检测器 5个)
    18. Fuzzers (模糊测试器 4个)
    16. Antimalware (反病毒 3个)
    17. Debuggers (调试器 5个)
    15. Password auditing (密码审核 12个)
    14. Encryption tools (加密工具 8个)
  • 原文地址:https://www.cnblogs.com/2050/p/1937894.html
Copyright © 2011-2022 走看看