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