zoukankan      html  css  js  c++  java
  • ecshop 头部库 page_header.lbi 里的{insert name='cart_info'} 什么意思

    这是个调用的函数,函数位置在 includes/lib_insert.php 文件里的 insert_cart_info 函数部分;

    /**
     * 调用购物车信息
     *
     * @access  public
     * @return  string
     */
    function insert_cart_info()
    {
        $sql = 'SELECT SUM(goods_number) AS number, SUM(goods_price * goods_number) AS amount' .
               ' FROM ' . $GLOBALS['ecs']->table('cart') .
               " WHERE session_id = '" . SESS_ID . "' AND rec_type = '" . CART_GENERAL_GOODS . "'";
        $row = $GLOBALS['db']->GetRow($sql);
    
        if ($row)
        {
            $number = intval($row['number']);
            $amount = floatval($row['amount']);
        }
        else
        {
            $number = 0;
            $amount = 0;
        }
    
        $str = sprintf($GLOBALS['_LANG']['cart_info'], $number, price_format($amount, false));
    
        return '<a href="flow.php" title="' . $GLOBALS['_LANG']['view_cart'] . '">' . $str . '</a>';
    }
  • 相关阅读:
    bzoj 2599
    bzoj 3697
    poj 1741
    bzoj 2741
    bzoj 5495
    bzoj 3261
    网络流24题——骑士共存问题 luogu 3355
    网络流24题——数字梯形问题 luogu 4013
    bzoj 3998
    网络流24题——魔术球问题 luogu 2765
  • 原文地址:https://www.cnblogs.com/ymj0906/p/5933255.html
Copyright © 2011-2022 走看看