lszyh
haoyuntao 5 months ago
parent 29fdc1c908
commit dc9d07cb27
  1. 8
      app/store/model/Goods.php
  2. 2
      app/store/service/Home.php

@ -19,7 +19,7 @@ use app\common\enum\goods\Status as GoodsStatusEnum;
use cores\exception\BaseException; use cores\exception\BaseException;
use app\common\model\Region; use app\common\model\Region;
use think\facade\Db; use think\facade\Db;
use app\common\model\Store as StoreModel;
/** /**
* 商品模型 * 商品模型
* Class Goods * Class Goods
@ -304,8 +304,10 @@ class Goods extends GoodsModel
* @return int * @return int
*/ */
public function getGoodsGroundingTotal(array $where = []): int public function getGoodsGroundingTotal(array $where = []): int
{ {
return $this->where($where)->where('is_delete', '=', 0)->where('status','=',10)->count(); $detail = StoreModel::where('status',1)->find();
$list = $this->where($where)->where('is_delete', '=', 0)->whereIn('channel',$detail['open_channel'])->where('status','=',10)->count();
return $list;
} }
/** /**

@ -87,7 +87,7 @@ class Home extends BaseService
'statistics' => [ 'statistics' => [
// 商品总数量 // 商品总数量
'goodsTotal' => $this->getGoodsTotal(), 'goodsTotal' => $this->getGoodsTotal(),
//上商品总数 //上商品总数
'getGoodsGroundingTotal' => $this->getGoodsGroundingTotal(), 'getGoodsGroundingTotal' => $this->getGoodsGroundingTotal(),
// 会员总人数 // 会员总人数
'userTotal' => $this->getUserTotal(), 'userTotal' => $this->getUserTotal(),

Loading…
Cancel
Save