Browse Source

特价商品区分市场 取消订单事务提示

master
Lemon 5 years ago
parent
commit
7b60fd0238
  1. 7
      app/Controller/OrderController.php
  2. 5
      app/Service/ShopCarService.php

7
app/Controller/OrderController.php

@ -107,7 +107,12 @@ class OrderController extends BaseController
$orderMain = OrderMain::where('id',$orderId)
->select('global_order_id')
->first();
return $this->success($this->orderService->onlineCancel($orderMain->global_order_id));
$res = $this->orderService->onlineCancel($orderMain->global_order_id);
if($res){
return $this->success($res);
}else{
return $this->result(ErrorCode::ORDER_FAILURE, '', '取消订单失败');
}
}
/**

5
app/Service/ShopCarService.php

@ -30,9 +30,10 @@ class ShopCarService implements ShopCarServiceInterface
//一个订单只能添加一个特价商品
if($params['money'] == 0.01){
$goods_exists = ShopCar::where([
['money','=',0.01],
['user_id','=',$params['user_id']],
['good_id','!=',$params['good_id']]
['good_id','!=',$params['good_id']],
['market_id','=',$params['market_id']],
['money','=',0.01]
])
->exists();
if($goods_exists){

Loading…
Cancel
Save