feat : rank
This commit is contained in:
@@ -98,9 +98,9 @@ class Sku extends Model
|
||||
|
||||
/**
|
||||
* @param array $spuIds
|
||||
* @return Collection
|
||||
* @return Collection|null
|
||||
*/
|
||||
public function getAddStapleFoodListBySpuIds(array $spuIds): Collection
|
||||
public function getAddStapleFoodListBySpuIds(array $spuIds): Collection|null
|
||||
{
|
||||
return $this
|
||||
->whereIn('spu_id',$spuIds)
|
||||
@@ -114,9 +114,9 @@ class Sku extends Model
|
||||
|
||||
/**
|
||||
* @param int $spuId
|
||||
* @return Collection
|
||||
* @return Collection|null
|
||||
*/
|
||||
public function getListBySpuId(int $spuId): Collection
|
||||
public function getListBySpuId(int $spuId): Collection|null
|
||||
{
|
||||
return $this
|
||||
->where('spu_id',$spuId)
|
||||
|
||||
@@ -73,9 +73,9 @@ class Spu extends Model
|
||||
* @param int $cycleId
|
||||
* @param int $kitchenId
|
||||
* @param int $type
|
||||
* @return Builder[]|Collection
|
||||
* @return Builder[]|Collection|null
|
||||
*/
|
||||
public function getListByCycleIdAndType(int $cycleId, int $kitchenId, int $type): Collection|array
|
||||
public function getListByCycleIdAndType(int $cycleId, int $kitchenId, int $type): Collection|array|null
|
||||
{
|
||||
return $this
|
||||
->where('cycle_id',$cycleId)
|
||||
|
||||
@@ -71,7 +71,7 @@ class AddStapleFoodInfoService extends BaseService
|
||||
|
||||
$spuInfo = $this->spuModel->getListByCycleIdAndType($cycleId, $kitchenId,GoodCode::SPU_TYPE_MEAL);
|
||||
if (empty($spuInfo)) return $this->return->success('success', ['add_food_info' => []]);
|
||||
$spuIds = array_column($spuInfo->toArray(), 'spu_id');
|
||||
$spuIds = array_column($spuInfo->toArray(), 'id');
|
||||
// $data = $this->goodCache->getMealGoodList();
|
||||
$skuInfo = $this->skuModel->getAddStapleFoodListBySpuIds($spuIds);
|
||||
if (empty($skuInfo)) return $this->return->success('success', ['add_food_info' => []]);
|
||||
|
||||
Reference in New Issue
Block a user