diff --git a/app/Domain/Entity/Product/BaseBrandModel.php b/app/Domain/Entity/Product/BaseBrandModel.php index aa9c8a3a..4fca812b 100644 --- a/app/Domain/Entity/Product/BaseBrandModel.php +++ b/app/Domain/Entity/Product/BaseBrandModel.php @@ -92,16 +92,6 @@ class BaseBrandModel extends Model ], ]; - /** - * 获取商品品牌列表. - */ - public function getList(array $arrIn = []): array - { - $arrIn['scope'] = 'list'; - - return $this->findListAndCount($arrIn); - } - /** * 添加更新商品品牌信息. */ @@ -139,16 +129,6 @@ public function updateInfo(array $arrIn): int return $intID; } - /** - * 获取商品品牌信息. - */ - public function getInfo(array $arrIn): mixed - { - $arrIn['scope'] = 'one'; - - return $this->findOne($arrIn); - } - /** * 删除一条记录. */ diff --git a/app/Infra/Model.php b/app/Infra/Model.php index ec29dfbb..afb033dc 100644 --- a/app/Infra/Model.php +++ b/app/Infra/Model.php @@ -318,7 +318,7 @@ public function index(string $index = ''): static return $this; } - public function sum(string $field = '*'): string|int|float + public function sum(string $field = '*'): string|int|float|null { return $this->callStatisticalQuery('sum', $field); } @@ -596,6 +596,26 @@ public function findOne(array $in = []): string|array return $this->find(); } + /** + * 获取信息. + */ + public function getInfo(array $in, string $scope = 'one'): mixed + { + $in['scope'] = $scope; + + return $this->findOne($in); + } + + /** + * 获取列表. + */ + public function getList(array $in = [], string $scope = 'list'): array + { + $in['scope'] = $scope; + + return $this->findListAndCount($in); + } + /** * 查询数据. */