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