zoukankan      html  css  js  c++  java
  • Tp5 写类下商品计算数量

    计算类下商品的分别数量

    1.静态

    <td>{:getCountTotal($vo['id'])}</td>

    2.common.php内写调用方法

    //将计算类下总笔数
    function getCountTotal($id)
    {
    // $total = Db::name('product_category')->where($id)->find()['id'];
    $number = Db::table('think_product')->where('product_special_id',$id)->count();//计算总页面
    return $number;
    }
    此计算是根据分类的id随之又进入商品的special_id进行查找,用count计算一下,类别商品数量则显示出来了!!!!!
  • 相关阅读:
    GPO
    GPO
    GPO
    Active Directory
    Active Directory
    Ethical Hacking
    Tree and Queries CodeForces
    数颜色 HYSBZ
    Powerful array CodeForces
    Group HDU
  • 原文地址:https://www.cnblogs.com/dennyxiao/p/8611365.html
Copyright © 2011-2022 走看看