order
parent
dd3c5e2e6e
commit
88e97dcb43
|
|
@ -77,7 +77,7 @@ class OrderController extends Controller
|
|||
$orderService = new OrderService();
|
||||
|
||||
return match (true) {
|
||||
$request->filled('order_pre') => $orderService->createOrderByPre($user, OrderPre::findOrFail($request->input('order_pre')), $request->input('coupon_id')),
|
||||
$request->filled('order_pre') => $orderService->createOrderByPre($user, OrderPre::findOrFail($request->input('order_pre')), $request->input('coupon_id'), $request->input('note')),
|
||||
$request->filled('product') => $orderService->createQuickOrder(
|
||||
$user,
|
||||
$validated['product']['sku_id'],
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ class OrderService
|
|||
* 添加店铺订单
|
||||
*
|
||||
*/
|
||||
public function createOrderByPre(User $user, OrderPre $order_pre, $coupon_id = null)
|
||||
public function createOrderByPre(User $user, OrderPre $order_pre, $coupon_id = null, $note = null)
|
||||
{
|
||||
$products = [];
|
||||
foreach($order_pre->products as $item) {
|
||||
|
|
@ -185,7 +185,7 @@ class OrderService
|
|||
}
|
||||
|
||||
$coupon_id = $coupon_id ?: data_get($order_pre, 'others.coupon_id');
|
||||
$note = data_get($order_pre, 'others.note');
|
||||
$note = $note ?: data_get($order_pre, 'others.note');
|
||||
|
||||
// 优惠券
|
||||
$coupon = null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue