媛媛*小怪兽
If you have choices,choose the best! If you have no choices,do the best! 人生就是不断在学习路上进步的!!!!!!

计算类下商品的分别数量

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计算一下,类别商品数量则显示出来了!!!!!

 

posted on 2018-03-20 18:28  媛味君  阅读(962)  评论(0编辑  收藏  举报