feat : rank

This commit is contained in:
2025-04-09 16:08:00 +08:00
parent ee0f550828
commit aac53d8264
2 changed files with 42 additions and 23 deletions

View File

@@ -96,6 +96,22 @@ class Sku extends Model
->get();
}
/**
* @param array $spuIds
* @return Collection
*/
public function getAddStapleFoodListBySpuIds(array $spuIds): Collection
{
return $this
->whereIn('spu_id',$spuIds)
->where('is_del',GoodCode::SKU_IS_NO_DEL)
->where('saleable',GoodCode::LISTING)
->where('is_add_staple_food',GoodCode::IS_ADD_STAPLE_FOOD)
->orderBy('sort')
->select(['id','spu_id','title','image_ids','price','param','extra','total_stock','surplus_stock','order_num','is_add_staple_food','occupied','chef_id'])
->first();
}
/**
* @param int $spuId
* @return Collection