6
0
Fork 0
base
panliang 2022-09-08 16:56:32 +08:00
parent dd3c5e2e6e
commit 88e97dcb43
2 changed files with 3 additions and 3 deletions

View File

@ -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'],

View File

@ -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;