在售数量

lszyh
haoyuntao 7 months ago
parent 624b07790a
commit 80bc386b55
  1. 10
      app/store/model/Goods.php
  2. 10
      app/store/service/Home.php

@ -298,6 +298,16 @@ class Goods extends GoodsModel
return $this->where($where)->where('is_delete', '=', 0)->count();
}
/**
* 获取当前商品已上架总数
* @param array $where
* @return int
*/
public function getGoodsGroundingTotal(array $where = []): int
{
return $this->where($where)->where('is_delete', '=', 0)->where('status','=',10)->count();
}
/**
* 创建商品数据
* @param array $data

@ -87,6 +87,8 @@ class Home extends BaseService
'statistics' => [
// 商品总数量
'goodsTotal' => $this->getGoodsTotal(),
//上级商品总数
'getGoodsGroundingTotal' => $this->getGoodsGroundingTotal(),
// 会员总人数
'userTotal' => $this->getUserTotal(),
// 付款订单总量
@ -137,6 +139,14 @@ class Home extends BaseService
{
return number_format($this->GoodsModel->getGoodsTotal());
}
/**
* 获取商品已上架总量
* @return string
*/
private function getGoodsGroundingTotal(): string
{
return number_format($this->GoodsModel->getGoodsGroundingTotal());
}
/**
* 会员总人数

Loading…
Cancel
Save