|
@@ -306,16 +306,16 @@ class RefundController extends Curd
|
|
|
if (sprintf("%.2f", $amount) == sprintf("%.2f", $order->order_amount_pay)) {
|
|
|
if (!empty($order->order_discount_json)) {
|
|
|
$discountJson = json_decode($order->order_discount_json, true);
|
|
|
- foreach ($discountJson as $item){
|
|
|
- if (empty($item['coupon_id'])){
|
|
|
+ foreach ($discountJson as $item) {
|
|
|
+ if (empty($item['coupon_id'])) {
|
|
|
continue;
|
|
|
}
|
|
|
// 是否有其他订单一起使用优惠券
|
|
|
- if(!Order::where('order_groupby',$order->order_groupby)->where('order_id','<>',$order->order_id)->where('order_is_complete','<>','R')->exists()){
|
|
|
- foreach ($item['coupon_detail_id'] as $detailId){
|
|
|
- CouponDetail::where('coupon_detail_id',$detailId)->update([
|
|
|
- 'coupon_detail_status'=>'ACTIVED',
|
|
|
- 'coupon_detail_used_datetime'=>''
|
|
|
+ if (!Order::where('order_groupby', $order->order_groupby)->where('order_id', '<>', $order->order_id)->where('order_is_complete', '<>', 'R')->exists()) {
|
|
|
+ foreach ($item['coupon_detail_id'] as $detailId) {
|
|
|
+ CouponDetail::where('coupon_detail_id', $detailId)->update([
|
|
|
+ 'coupon_detail_status' => 'ACTIVED',
|
|
|
+ 'coupon_detail_used_datetime' => ''
|
|
|
]);
|
|
|
}
|
|
|
}
|
|
@@ -395,11 +395,11 @@ class RefundController extends Curd
|
|
|
return json_success('success');
|
|
|
} catch (BusinessException $e) {
|
|
|
Db::rollBack();
|
|
|
- dump($e->getMessage());
|
|
|
+ Log::info("退款失败", ['msg' => $e->getMessage()]);
|
|
|
return json_fail($e->getMessage());
|
|
|
} catch (\Exception $e) {
|
|
|
Db::rollBack();
|
|
|
- dump($e->getMessage());
|
|
|
+ Log::info("退款失败", ['msg' => $e->getMessage()]);
|
|
|
return json_fail("退款失败");
|
|
|
}
|
|
|
}
|