ecshop二次開發摘要

ECSHOP 二次開發摘要
php

數據表及說明:html

ecs_account_log 會員帳目日誌表mysql

ecs_ad 廣告詳細表web

ecs_ad_custom 自定義廣告播放器sql

ecs_ad_position 廣告位置表數據庫

ecs_admin_action 全部權限表json

ecs_admin_log 後臺管理員操做日誌數組

ecs_admin_message 管理員留言信息瀏覽器

ecs_admin_user 管理員列表緩存

ecs_adsense 站外廣告詳細表

ecs_affiliate_log 推薦備註表

ecs_agency 辦事處表

ecs_area_region 地區表

ecs_article 文章表

ecs_article_cat 文章分類表

ecs_attribute 屬性詳細列表

ecs_auction_log 拍賣活動出價表

ecs_auto_manage 商品自動上下架表

ecs_back_goods 退貨商品

ecs_back_order 退貨單

ecs_bonus_type 紅包類型表

ecs_booking_goods 缺貨登記表

ecs_brand 商品品牌表

ecs_card 祝福卡表

ecs_cart 購物車

ecs_cat_recommend 欄目是否首頁推薦1 精品2 最新3 熱門

ecs_category 商品分類表

ecs_collect_goods 會員收藏商品表

ecs_comment 用戶評論表

ecs_crons 商店計劃任務

ecs_delivery_goods 發貨商品表

ecs_delivery_order 發貨單表

ecs_email_list 訂閱列表表

ecs_email_sendlist 郵件發送列表

ecs_error_log 錯誤日誌表

ecs_exchange_goods 積分商品表

ecs_favourable_activity 優惠活動表

ecs_feedback 會員留言信息表

ecs_friend_link 友情鏈接表

ecs_goods 商品表

ecs_goods_activity 促銷管理act_type 0 奪寶奇兵1 團購2 拍賣4 超值大禮包

ecs_goods_article 關聯文章

ecs_goods_attr 商品屬性

ecs_goods_cat 商品擴展分類

ecs_goods_gallery 商品相冊

ecs_goods_type 商品屬性分類

ecs_group_goods 組合(配件)商品

ecs_keywords 網站關鍵字表

ecs_link_goods 關聯商品表

ecs_mail_templates 郵件模板表

ecs_member_price 會員指訂價格表

ecs_nav 頁面導航欄表

ecs_order_action 訂單備註表

ecs_order_goods 訂單商品表

ecs_order_info 訂單表

ecs_pack 商品包裝表

ecs_package_goods 超值大禮包商品

ecs_pay_log 自付備註表

ecs_payment 支付方式

ecs_plugins 插件表

ecs_reg_extend_info 新註冊用戶的擴展信息表

ecs_reg_fields 新註冊用戶的擴展字段信息表

ecs_region 網站地區表

ecs_searchengine 搜索引擎表

ecs_sessions session 表

ecs_sessions_data session 備份表

ecs_shipping 配送方式

ecs_shipping_area 配送區域

ecs_shop_config 商店設置表

ecs_snatch_log 奪寶奇兵用戶出價詳細表

ecs_stats 流量詳細表

ecs_suppliers 供貨商表

ecs_tag 商品標籤表

ecs_template 網站模板表

ecs_topic 專題活動表

ecs_user_account 用戶資金錶

ecs_user_address 用戶地址

ecs_user_bonus 用戶紅包表

ecs_user_feed 沒有操做該表

ecs_user_rank 用戶等級表

ecs_users 用戶表

ecs_virtual_card 虛擬卡表

ecs_volume_price 商品優惠價格表

ecs_vote 調查表

ecs_vote_log 調查日誌表

ecs_vote_option 調查選項

ecs_wholesale 批發表

模板主要語法備註:

<!-- #BeginLibraryItem "/library/page_header.lbi" --><!-- #EndLibraryItem --> 包

含/library/page_header.lbi 這個路徑模板

$smarty->is_cached('goods.dwt', $cache_id); //判讀該$cache_id 是否緩存

$smarty->assign('p_w_picpath_width', $_CFG['p_w_picpath_width']); //模板賦值

$smarty->display('goods.dwt', $cache_id);//以$cache_id 緩存該文件,而且顯示該文

1.判讀語法

a.<!-- {if $cat_list} -->

<!-- {/if} -->

b.<!-- {if $cat_list} -->

<!-- {else} -->

<!-- {/if} -->

c.<!-- {if $cat_list} -->

<!-- {elseif $pager.display == 'grid'} -->

<!-- {/if} -->

2.循環語法

<!-- {foreach from=$brand_list name="brand_list_foreach" item=brand_data} -->

<!--{/foreach}-->

獲得循環下標:$smarty.foreach.brand_list_foreach.index

3.忽略語法

{literal}

{/literal}

4.比較運算符

or > == eq mod neq 等

主要文件功能說明:

Data/

-----config.php 網站配置文件

-----flashdata/ 網站幻燈文件

-----captcha/ 驗證碼背景文件

Includes/

-----codetable/ 文字編碼文件

------fckeditor/ 編輯器文件

------modules/

----------------payment/ 支付文件

----------------shipping/ 配送文件

----------------integrates/ 外部整合文件

----------------cron/ 按期執行文件

-----------------convert/ shopex 轉換文件

------cls_captcha.php 驗證碼類

------cls_ecshop.php Ecshop基礎類

------cls_error.php 錯誤日誌類

------cls_iconv.php 字符集轉換類

------cls_p_w_picpath.php 上傳圖片文件的處理類(實現圖片上傳,圖片縮小, 增長水印)

------cls_json.php json處理類

------cls_mysql.php 數據庫操做類

------cls_rss.php rss 操做類

------cls_session.php session 操做類

------cls_sms.php 短信模型類

------cls_smtp.php 郵件發送類

------cls_sql_executor.php SQL語句執行類

------cls_template.php 模板編譯類

------cls_transport.php 信息傳送類包括fsockopen curl

------inc_constant.php 網站常量文件

------init.php 網站初始化文件

------lib.debug.php debug測試文件

------lib_article.php 文章及文章分類相關函數庫

-------+ get_cat_articles($cat_id, $page = 1, $size = 20 ,$requirement='') 文章

分類下的文章列表

-------+ get_article_count($cat_id ,$requirement='') 得到指定分類下的文章總數

-------lib_base.php 網站經常使用函數庫

-------+ sub_str($str, $length = 0, $append = true) 截取UTF-8 編碼下字符串的函數

-------+ real_ip() 得到用戶的真實IP 地址

-------+ str_len($str) 計算字符串的長度(漢字按照兩個字符計算)

-------+ get_crlf() 得到用戶操做系統的換行符

-------+ send_mail($name, $email, $subject, $content, $type = 0,

$notification=false) 郵件發送

-------+ gd_version() 得到服務器上的GD 版本

-------+ file_mode_info($file_path) 文件或目錄權限檢查函數

-------+log_write($arg, $file = '', $line = '') 寫日誌到文件函數

-------+make_dir($folder) 檢查目標文件夾是否存在,若是不存在則自動建立該目錄

-------+gzip_enabled() 得到系統是否啓用了gzip

-------+addslashes_deep($value) 遞歸方式的對變量中的特殊字符進行轉義

-------+addslashes_deep_obj($obj) 將對象成員變量或者數組的特殊字符進行轉義

-------+ stripslashes_deep($value) 遞歸方式的對變量中的特殊字符去除轉義

-------+make_semiangle($str) 一個字串中含有全角的數字字符、字母、空格或'%+-()'

字符轉換爲相應半角字符

-------+check_file_type($filename, $realname = '', $limit_ext_types = '') 檢查文

件類型

-------+mysql_like_quote($str) 對MYSQL LIKE 的內容進行轉義

-------+real_server_ip() 獲取服務器的ip

-------+ecs_header($string, $replace = true, $http_response_code = 0) 自定義header

函數

-------+ecs_iconv($source_lang, $target_lang, $source_string = '') 字符串轉換函

-------+ecs_geoip($ip) 獲取ip 返回區域

-------+trim_right($str) 去除字符串右側可能出現的亂碼

-------+ move_upload_file($file_name, $target_name = '') 將上傳文件轉移到指定位

-------+json_str_iconv($str) 將JSON 傳遞的參數轉碼

-------+get_file_suffix($file_name, $allow_type = array()) 獲取文件後綴名,並判斷

是否合法

-------+read_static_cache($cache_name) 讀結果緩存文件

-------+ write_static_cache($cache_name, $caches) 寫結果緩存文件

-------lib_clips.php 用戶相關函數庫

-------+get_collection_goods($user_id, $num = 10, $start = 0) 獲取指定用戶的收藏

商品列表

-------+get_booking_rec($user_id, $goods_id) 查看此商品是否已進行過缺貨登記

-------+get_message_list($user_id, $user_name, $num, $start, $order_id = 0) 獲取

指定用戶的留言

-------+add_message($message) 添加留言函數

-------+get_user_tags($user_id = 0) 獲取用戶的tags

-------+ delete_tag($tag_words, $user_id) 驗證性的刪除某個tag

-------+get_booking_list($user_id, $num, $start) 獲取某用戶的缺貨登記列表

-------+get_goodsinfo($goods_id) 獲取某用戶的缺貨登記列表

-------+delete_booking($booking_id, $user_id) 驗證刪除某個收藏商品

-------+add_booking($booking) 添加缺貨登記記錄到數據表

-------+insert_user_account($surplus, $amount) 插入會員帳目明細

-------+update_user_account($surplus) 更新會員帳目明細

-------+insert_pay_log($id, $amount, $type = PAY_SURPLUS, $is_paid = 0) 將支付LOG

插入數據表

-------+get_paylog_id($surplus_id, $pay_type = PAY_SURPLUS) 取得上次未支付的

pay_lig_id

-------+get_surplus_info($surplus_id) 根據ID 獲取當前餘額操做信息

-------+get_online_payment_list($include_balance = true) 取得已安裝的支付方式(其

中不包括線下支付的)

-------+get_account_log($user_id, $num, $start) 查詢會員餘額的操做記錄

-------+del_user_account($rec_id, $user_id) 刪除未確認的會員賬目信息

-------+get_user_surplus($user_id) 查詢會員餘額的數量

-------+ get_user_default($user_id) 獲取用戶中心默認頁面所需的數據

-------+add_tag($id, $tag) 添加商品標籤

-------+color_tag(&$tags) 標籤着色

-------+ get_rank_info() 取得用戶等級信息

-------+ get_user_prompt ($user_id) 獲取用戶參與活動信息

-------+ get_comment_list($user_id, $page_size, $start) 獲取用戶評論

--------lib_code.php 加密解密類

-------+ encrypt($str, $key = AUTH_KEY) 加密函數

-------+ decrypt($str, $key = AUTH_KEY) 解密函數

--------lib_common.php 公用函數庫

-------+db_create_in($item_list, $field_name = '') 建立像這樣的查詢:

"IN('a','b')"  

-------+ is_time($time) 檢查是否爲一個合法的時間格式

-------+ assign_query_info() 得到查詢時間和次數,並賦值給smarty

-------+ region_result($parent, $sel_name, $type) 建立地區的返回信息

-------+ is_email($user_email) 驗證輸入的郵件地址是否合法

-------+ get_regions($type = 0, $parent = 0) 得到指定國家的全部省份

-------+ get_shipping_config($area_id) 得到配送區域中指定的配送方式的配送費用的

計算參數

-------+ &init_users() 初始化會員數據整合類

-------+ cat_list($cat_id = 0, $selected = 0, $re_type = true, $level = 0,

$is_show_all = true) 得到指定分類下的子分類的數組

-------+ cat_options($spec_cat_id, $arr) 過濾和排序全部分類,返回一個帶有縮進級

別的數組

-------+load_config() 載入配置信息

-------+ get_brand_list() 取得品牌列表

-------+ get_brands($cat = 0, $app = 'brand') 得到某個分類下

-------+get_promotion_info($goods_id = '') 全部的促銷活動信息

-------+get_children($cat = 0) 得到指定分類下全部底層分類的ID

-------+get_article_children ($cat = 0) 得到指定文章分類下全部底層分類的ID

-------+get_mail_template($tpl_name) 獲取郵件模板

-------+ order_action($order_sn, $order_status, $shipping_status, $pay_status,

$note = '', $username = null) 訂單操做記錄

-------+price_format($price, $change_price = true) 格式化商品價格

-------+get_virtual_goods($order_id, $shipping = false) 返回訂單中的虛擬商品

-------+virtual_goods_ship(&$virtual_goods, &$msg, $order_sn, $return_result =

false, $process = 'other') 虛擬商品發貨

-------+virtual_card_shipping ($goods, $order_sn, &$msg, $process = 'other') 虛

擬卡發貨

-------+virtual_card_result($order_sn, $goods) 返回虛擬卡信息

-------+get_snatch_result($id) 獲取指定id snatch 活動的結果

-------+clear_tpl_files($is_cache = true, $ext = '') 清除指定後綴的模板緩存或編

譯文件

-------+clear_compiled_files($ext = '') 清除模版編譯文件

-------+clear_cache_files($ext = '') 清除緩存文件

-------+clear_all_files($ext = '') 清除模版編譯和緩存文件

-------+smarty_insert_scripts($args) 頁面上調用的js 文件

-------+smarty_create_pages($params) 建立分頁的列表

-------+ build_uri($app, $params, $append = '', $page = 0, $size = 0) 重寫URL 地

-------+formated_weight($weight) 格式化重量:小於1 千克用克表示,不然用千克表示

-------+log_account_change($user_id, $user_money = 0, $frozen_money = 0,

$rank_points = 0, $pay_points = 0, $change_desc

= '', $change_type = ACT_OTHER) 記錄賬戶變更

-------+article_cat_list($cat_id = 0, $selected = 0, $re_type = true, $level = 0)

得到指定分類下的子分類的數組

-------+article_cat_options($spec_cat_id, $arr) 過濾和排序全部文章分類,返回一個

帶有縮進級別的數組

-------+uc_call($func, $params=null) 調用UCenter 的函數

-------+exception_handler($errno, $errstr, $errfile, $errline) error_handle 回調

函數

-------+get_p_w_picpath_path($goods_id, $p_w_picpath='', $thumb=false, $call='goods',

$del=false)從新得到商品圖片與商品相冊的地址

-------+get_volume_price_list($goods_id, $price_type = '1') 取得商品優惠價格列表

-------+get_final_price($goods_id, $goods_num = '1', $is_spec_price = false, $spec

= array()) 取得商品最終使用價格

-------+get_package_info($id) 獲取指定id package 的信息

-------+get_package_goods($package_id) 得到指定禮包的商品

--------lib_goods.php 商品相關函數庫

-------+goods_sort($goods_a, $goods_b) 商品推薦usort 用自定義排序行數

-------+get_categories_tree($cat_id = 0) 得到指定分類同級的全部分類以及該分類下

的子分類

-------+get_child_tree($tree_id = 0) 該分類下的子分類

-------+get_top10($cats = '') 調用當前分類的銷售排行榜

-------+get_recommend_goods($type = '', $cats = '') 得到推薦商品

-------+get_promote_goods($cats = '') 得到促銷商品

-------+get_category_recommend_goods($type = '', $cats = '', $brand = 0, $min =0,

$max = 0, $ext='') 得到指定分類下的推薦商品

-------+get_goods_info($goods_id) 得到商品的詳細信息

-------+get_goods_properties($goods_id) 得到商品的屬性和規格

-------+get_same_attribute_goods($attr) 得到屬性相同的商品

-------+get_goods_gallery($goods_id) 得到指定商品的相冊

-------+assign_cat_goods($cat_id, $num = 0, $from = 'web') 得到指定分類下的商品

-------+assign_brand_goods($brand_id, $num = 0, $cat_id = 0) 得到指定的品牌下的

商品

-------+get_extension_goods($cats) 得到全部擴展分類屬於指定分類的全部商品ID

-------+bargain_price($price, $start, $end) 判斷某個商品是否正在特價促銷期

-------+spec_price($spec) 得到指定的規格的價格

-------+group_buy_info($group_buy_id, $current_num = 0) 取得團購活動信息

-------+group_buy_stat($group_buy_id, $deposit) 取得某團購活動統計信息

-------+group_buy_status($group_buy) 得到團購的狀態

-------+auction_info($act_id, $config = false) 取得拍賣活動信息

-------+auction_log($act_id) 取得拍賣活動出價記錄

-------+auction_status($auction) 計算拍賣活動狀態(注意參數必定是原始信息)

-------+goods_info($goods_id) 取得商品信息

-------+favourable_info($act_id) 取得優惠活動信息

-------+wholesale_info($act_id) 批發信息

-------+add_style($goods_name, $style) 添加商品名樣式

-------+get_goods_attr($goods_id) 取得商品屬性

-------+get_goods_fittings($goods_list = array()) 得到購物車中商品的配件

--------lib_insert.php 動態內容函數庫

-------+insert_query_info() 得到查詢次數以及查詢時間

-------+insert_history() 調用瀏覽歷史

-------+insert_cart_info() 調用購物車信息

-------+insert_ads($arr) 調用指定的廣告位的廣告

-------+insert_member_info() 調用會員信息

-------+insert_comments($arr) 調用評論信息

-------+insert_vote() 調用在線調查信息

--------lib_main.php 前臺公用函數庫

-------+update_user_info() 更新用戶SESSION,COOKIE 及登陸時間、登陸次數。

-------+get_user_info($id=0) 獲取用戶信息數組

-------+assign_ur_here($cat = 0, $str = '') 取得當前位置和頁面標題

-------+get_parent_cats($cat) 得到指定分類的全部上級分類

-------+build_pagetitle($arr, $type = 'category') 根據提供的數組編譯成頁面標題

-------+build_urhere($arr, $type = 'category') 根據提供的數組編譯成當前位置

-------+assign_dynamic($tmp) 得到指定頁面的動態內容

-------+assign_articles($id, $num) 分配文章列表給smarty

-------+get_shop_help() 分配幫助信息

-------+assign_pager($app, $cat, $record_count, $size, $sort, $order, $page = 1,

$keywords = '', $brand = 0, $price_min = 0, $price_max = 0, $display_type = 'list',

$filter_attr='',

$url_format='', $sch_array='') 建立分頁信息

-------+get_pager($url, $param, $record_count, $page = 1, $size = 10) 生成給

pager.lbi 賦值的數組

-------+get_vote($id = '') 調用調查內容

-------+get_user_browser() 得到瀏覽器名稱和版本

-------+is_spider($record = true) 判斷是否爲搜索引擎蜘蛛

-------+get_os() 得到客戶端的操做系統

-------+visit_stats() 統計訪問信息

-------+save_searchengine_keyword($domain, $path) 保存搜索引擎關鍵字

-------+get_tags($goods_id = 0, $user_id = 0) 得到指定用戶、商品的全部標記

-------+get_dyna_libs($theme, $tmp) 獲取指定主題某個模板的主題的動態模塊

-------+dyna_libs_replace($matches) 替換動態模塊

-------+upload_file($upload, $type) 處理上傳文件,並返回上傳圖片名(上傳失敗時返

回圖片名爲空)

-------+show_message($content, $links = '', $hrefs = '', $type = 'info',

$auto_redirect = true) 顯示一個提示信息

-------+parse_rate_value($str, &$operate) 將一個形如+10, 10, -10, 10%的字串轉換

爲相應數字,並返回操做符號

-------+recalculate_price() 從新計算購物車中的商品價格

-------+assign_comment($id, $type, $page = 1) 查詢評論內容

-------+assign_template($ctype = '', $catlist = array()) 設置全局信息

-------+time2gmt($time) 將一個本地時間戳轉成GMT 時間戳

-------+get_user_bonus($user_id = 0) 查詢會員的紅包金額

-------+set_affiliate() 保存推薦uid

-------+get_affiliate() 獲取推薦uid

-------+article_categories_tree($cat_id = 0) 得到指定分類同級的全部分類以及該分

類下的子分類

-------+get_article_parent_cats($cat) 得到指定文章分類的全部上級分類

-------+get_library_number($library, $template = null) 取得某模板某庫設置的數量

-------+get_navigator($ctype = '', $catlist = array()) 取得自定義導航欄列表

-------+license_info() 受權信息內容

--------lib_order.php 購物流程函數庫

-------+unserialize_config($cfg) 處理序列化的支付、配送的配置參數

-------+shipping_list() 取得已安裝的配送方式

-------+shipping_info($shipping_id) 取得配送方式信息

-------+available_shipping_list($region_id_list) 取得可用的配送方式列表

-------+shipping_area_info($shipping_id, $region_id_list) 取得某配送方式對應於

某收貨地址的區域信息

-------+shipping_fee($shipping_code, $shipping_config, $goods_weight,

$goods_amount, $goods_number='') 計算運費

-------+shipping_insure_fee($shipping_code, $goods_amount, $insure) 獲取指定配送

的保價費用

-------+payment_list() 取得已安裝的支付方式列表

-------+payment_info($pay_id) 取得支付方式信息

-------+pay_fee($payment_id, $order_amount, $cod_fee=null) 得到訂單須要支付的支

付費用

-------+available_payment_list($support_cod, $cod_fee = 0, $is_online = false) 取

得可用的支付方式列表

-------+pack_list() 取得包裝列表

-------+pack_info($pack_id) 取得包裝信息

-------+pack_fee($pack_id, $goods_amount) 根據訂單中的商品總額來得到包裝的費用

-------+card_list() 取得賀卡列表

-------+card_info($card_id) 取得賀卡信息

-------+card_fee($card_id, $goods_amount) 根據訂單中商品總額得到須要支付的賀卡

費用

-------+order_info($order_id, $order_sn = '') 取得訂單信息

-------+order_finished($order) 判斷訂單是否已完成

-------+order_goods($order_id) 取得訂單商品

-------+order_amount($order_id, $include_gift = true) 取得訂單總金額

-------+order_weight_price($order_id) 取得某訂單商品總重量和總金額(對應

cart_weight_price)

-------+order_fee($order, $goods, $consignee) 得到訂單中的費用信息

-------+update_order($order_id, $order) 修改訂單

-------+get_order_sn() 獲得新訂單號

-------+cart_goods($type = CART_GENERAL_GOODS) 取得購物車商品

-------+cart_amount($include_gift = true, $type = CART_GENERAL_GOODS) 取得購物車

總金額

-------+cart_goods_exists($id, $spec, $type = CART_GENERAL_GOODS) 檢查某商品是否

已經存在於購物車

-------+cart_weight_price($type = CART_GENERAL_GOODS) 得到購物車中商品的總重量、

總價格、總數量

-------+addto_cart($goods_id, $num = 1, $spec = array(), $parent = 0) 添加商品到

購物車

-------+clear_cart($type = CART_GENERAL_GOODS) 清空購物車

-------+get_goods_attr_info($arr) 得到指定的商品屬性

-------+user_info($user_id) 取得用戶信息

-------+update_user($user_id, $user) 修改用戶

-------+address_list($user_id) 取得用戶地址列表

-------+address_info($address_id) 取得用戶地址信息

-------+user_bonus($user_id, $goods_amount = 0) 取得用戶當前可用紅包

-------+bonus_info($bonus_id, $bonus_sn = '') 取得紅包信息

-------+bonus_used($bonus_id) 檢查紅包是否已使用

-------+use_bonus($bonus_id, $order_id) 設置紅包爲已使用

-------+unuse_bonus($bonus_id) 設置紅包爲未使用

-------+value_of_integral($integral) 計算積分的價值(能抵多少錢)

-------+integral_of_value($value) 計算指定的金額須要多少積分

-------+order_refund($order, $refund_type, $refund_note, $refund_amount = 0) 訂

單退款

-------+get_cart_goods() 得到購物車中的商品

-------+get_consignee($user_id) 取得收貨人信息

-------+exist_real_goods($order_id = 0, $flow_type = CART_GENERAL_GOODS) 查詢購

物車(訂單id 爲0)或訂單中是否有實體商品

-------+check_consignee_info($consignee, $flow_type) 檢查收貨人信息是否完整

-------+last_shipping_and_payment() 得到上一次用戶採用的支付和配送方式

-------+get_total_bonus() 取得當前用戶應該獲得的紅包總額

-------+change_user_bonus($bonus_id, $order_id, $is_used = true) 處理紅包(下訂

單時設爲使用,取消(無效,退貨)訂單時設爲未使用

-------+flow_order_info() 得到訂單信息

-------+merge_order($from_order_sn, $to_order_sn) 合併訂單

-------+get_agency_by_regions($regions) 查詢配送區域屬於哪一個辦事處管轄

-------+&get_shipping_object($shipping_id) 獲取配送插件的實例

-------+change_order_goods_storage($order_id, $is_dec = true, $storage = 0) 改變

訂單中商品庫存

-------+change_goods_storage($good_id, $number = 0) 商品庫存增與減

-------+payment_id_list($is_cod) 取得支付方式id 列表

-------+order_query_sql($type = 'finished', $alias = '') 生成查詢訂單的sql

-------+order_amount_field($alias = '') 生成查詢訂單總金額的字段

-------+order_due_field($alias = '') 生成計算應付款金額的字段

-------+compute_discount() 計算折扣:根據購物車和優惠活動

-------+get_give_integral() 取得購物車該贈送的積分數

-------+integral_to_give($order) 取得某訂單應該贈送的積分數

-------+send_order_bonus($order_id) 發紅包:發貨時發紅包

-------+return_order_bonus($order_id) 返回訂單發放的紅包

-------+order_bonus($order_id) 取得訂單應該發放的紅包

-------+compute_discount_amount() 計算購物車中的商品能享受紅包支付的總額

-------+add_package_to_cart($package_id, $num = 1) 添加禮包到購物車

-------+get_delivery_sn() 獲得新發貨單號

-------+judge_package_stock($package_id, $package_num = 1) 檢查禮包內商品的庫存

二次開發:(會員積分排行榜)

網站後臺-->系統設置->自定義導航->添加自定義導航,輸入會員積分龍虎榜鏈接地址

membertop10.php

包含系統主要文件

define('IN_ECS', true);

require(dirname(__FILE__) . '/includes/init.php');

//執行SQL 語句

$sql = 'SELECT * FROM ' . $GLOBALS['ecs']->table('users') . ' ORDER BY user_money

DESC LIMIT 50';

$all = $GLOBALS['db']->getAll($sql);

//編譯模板

$smarty->assign("all", $all);

$smarty->display('membertop10.dwt');

在themes/default/membertop10.dwt

<!--{foreach from=$all item=goods name="promotion_foreach"}-->

<div class="goodList">>

<p>{$goods.user_name|escape:html}</p>

</div>

<!--{/foreach}-->

相關文章
相關標籤/搜索