diff --git a/app/Service/v3/Implementations/OrderListService.php b/app/Service/v3/Implementations/OrderListService.php index 9c576a9..4baac01 100644 --- a/app/Service/v3/Implementations/OrderListService.php +++ b/app/Service/v3/Implementations/OrderListService.php @@ -197,7 +197,7 @@ class OrderListService implements OrderListServiceInterface public function autoCancel($userId) { return OrderMain::query() - ->where(['user_id' => $userId]) + ->where(['user_id' => $userId, 'state' => OrderState::UNPAID]) ->where('created_at', '<', time()-900) ->update(['state' => OrderState::CANCELED]); } diff --git a/app/Service/v3/Implementations/OrderOnlineService.php b/app/Service/v3/Implementations/OrderOnlineService.php index 456bcee..58e0764 100644 --- a/app/Service/v3/Implementations/OrderOnlineService.php +++ b/app/Service/v3/Implementations/OrderOnlineService.php @@ -209,9 +209,9 @@ class OrderOnlineService implements OrderOnlineServiceInterface 'price' => $goods->price, 'original_price' => $goods->original_price, 'vip_price' => $goods->vip_price, - 'name' => $goods->name, - 'goods_unit' => $goods->goods_unit, - 'cover_img' => $goods->cover_img, + 'name' => $goods->name ?: '', + 'goods_unit' => $goods->goods_unit ?: '', + 'cover_img' => $goods->cover_img ?: '', 'spec' => json_encode($goods->spec), ]; } @@ -346,7 +346,7 @@ class OrderOnlineService implements OrderOnlineServiceInterface } catch (Exception $e) { Db::rollBack(); $this->log->event(LogLabel::ORDER_ONLINE_LOG, ['msg' => $e->getMessage()]); - throw new ErrorCodeException(ErrorCode::ORDER_ONLINE_FAIL, $e->getMessage()); + throw new ErrorCodeException(ErrorCode::ORDER_ONLINE_FAIL); } } diff --git a/app/Service/v3/Implementations/PaymentService.php b/app/Service/v3/Implementations/PaymentService.php index 65e6235..4d81f26 100644 --- a/app/Service/v3/Implementations/PaymentService.php +++ b/app/Service/v3/Implementations/PaymentService.php @@ -142,7 +142,7 @@ class PaymentService implements PaymentServiceInterface throw new ErrorCodeException(ErrorCode::REFUND_PAYMENT_FAIL,$result['err_code_des']); } } catch (\Exception $e) { - $this->log->event(LogLabel::ORDER_PAYMENT_LOG, ['payment_do_exception_msg' => $e->getMessage()]); + $this->log->event(LogLabel::ORDER_REFUND_LOG, ['payment_do_exception_msg' => $e->getMessage()]); throw new ErrorCodeException(ErrorCode::REFUND_PAYMENT_FAIL, '[退款失败]'.$e->getMessage()); }