feat: stock
This commit is contained in:
@@ -42,4 +42,14 @@ class OrderGood extends Model
|
||||
const string CREATED_AT = 'create_time';
|
||||
|
||||
const string UPDATED_AT = 'update_time';
|
||||
|
||||
/**
|
||||
* 根据订单获取商品id
|
||||
* @param int $orderId
|
||||
* @return array
|
||||
*/
|
||||
public function getGoodIdsByOrderId(int $orderId): array
|
||||
{
|
||||
return $this->where('order_id', $orderId)->select('sku_id','SUM(`quantity`) as `quantity`')->get()->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user