feat: sku
This commit is contained in:
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Model;
|
||||
|
||||
use App\Constants\Common\GoodCode;
|
||||
use Hyperf\Collection\Collection;
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\DbConnection\Model\Model;
|
||||
|
||||
@@ -60,9 +61,13 @@ class Sku extends Model
|
||||
return $this->where('id',$id)->where('is_del',GoodCode::SKU_IS_NO_DEL)->first();
|
||||
}
|
||||
|
||||
public function getListBySpuIds(array $spuIds): array
|
||||
/**
|
||||
* @param array $spuIds
|
||||
* @return Collection
|
||||
*/
|
||||
public function getListBySpuIds(array $spuIds): Collection
|
||||
{
|
||||
return $this->skuModel
|
||||
return $this
|
||||
->whereIn('spu_id',$spuIds)
|
||||
->where('is_del',GoodCode::SKU_IS_NO_DEL)
|
||||
->where('saleable',GoodCode::LISTING)
|
||||
|
||||
Reference in New Issue
Block a user