feat : rank
This commit is contained in:
@@ -12,7 +12,8 @@ use Hyperf\DbConnection\Model\Model;
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $spu_id
|
||||
* @property string $title
|
||||
* @property string $title
|
||||
* @property string $sub_title
|
||||
* @property string $image_ids
|
||||
* @property string $price
|
||||
* @property string $param
|
||||
@@ -94,6 +95,21 @@ class Sku extends Model
|
||||
->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $spuId
|
||||
* @return Collection
|
||||
*/
|
||||
public function getListBySpuId(int $spuId): Collection
|
||||
{
|
||||
return $this
|
||||
->where('spu_id',$spuId)
|
||||
->where('is_del',GoodCode::SKU_IS_NO_DEL)
|
||||
->where('saleable',GoodCode::LISTING)
|
||||
->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','sub_title'])
|
||||
->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $ids
|
||||
* @return array
|
||||
|
||||
Reference in New Issue
Block a user