计算类下商品的分别数量

1.静态

 

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

 

Tp5 写类下商品计算数量

2.common.php内写调用方法

Tp5 写类下商品计算数量

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

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2021-06-01
  • 2021-07-10
  • 2022-12-23
  • 2021-05-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-15
  • 2022-12-23
  • 2021-12-17
  • 2021-12-08
  • 2021-06-23
相关资源
相似解决方案