feat: stock
This commit is contained in:
@@ -75,4 +75,20 @@ class Sku extends Model
|
||||
->select(['id','spu_id','title','image_ids','price','param','extra','total_stock','surplus_stock','order_num'])
|
||||
->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $ids
|
||||
* @return array
|
||||
*/
|
||||
public function getDataArrByIds(array $ids): array
|
||||
{
|
||||
$res = $this
|
||||
->whereIn('id',$ids)
|
||||
->orderBy('sort')
|
||||
->get();
|
||||
|
||||
if (empty($res)) return [];
|
||||
|
||||
return $res->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user