diff --git a/app/Model/v3/OrderMain.php b/app/Model/v3/OrderMain.php index c3abfc8..3e2c185 100644 --- a/app/Model/v3/OrderMain.php +++ b/app/Model/v3/OrderMain.php @@ -91,6 +91,15 @@ class OrderMain extends Model return Shipping::getMessage($this->attributes['shipping_type']); } + public function getNoteAttribute($value) + { + if ($this->attributes['refuse_refund_note'] || $this->attributes['total_refund_note']) { + return $this->attributes['refuse_refund_note'] ?: $this->attributes['total_refund_note']; + } + + return $value; + } + public function market() { return $this->belongsTo(Market::class, 'market_id', 'id'); diff --git a/app/Service/v3/Implementations/OrderListService.php b/app/Service/v3/Implementations/OrderListService.php index db7f6c7..99bae87 100644 --- a/app/Service/v3/Implementations/OrderListService.php +++ b/app/Service/v3/Implementations/OrderListService.php @@ -161,7 +161,8 @@ class OrderListService implements OrderListServiceInterface ->with(['orders' => function($query) { $query->with('store'); }]) - ->where(['user_id' => $userId, 'type' => OrderType::OFFLINE]); + ->where(['user_id' => $userId, 'type' => OrderType::OFFLINE]) + ->whereIn('state', [OrderState::PAID,OrderState::DELIVERY,OrderState::COMPLETED]); $paginate = $builder->orderBy('created_at', 'desc')->paginate($pagesize); $orders = $paginate->toArray(); diff --git a/app/Service/v3/Implementations/PaymentService.php b/app/Service/v3/Implementations/PaymentService.php index 58b25b5..dff2b8d 100644 --- a/app/Service/v3/Implementations/PaymentService.php +++ b/app/Service/v3/Implementations/PaymentService.php @@ -130,12 +130,8 @@ class PaymentService implements PaymentServiceInterface if ($result['return_code'] == 'SUCCESS' && isset($result['result_code']) && $result['result_code'] == "SUCCESS") { return true; } else { - throw new ErrorCodeException(ErrorCode::PAYMENT_FAIL); + throw new ErrorCodeException(ErrorCode::PAYMENT_FAIL,$result['err_code_des']); } - - - - return $result; } catch (\Exception $e) { $this->log->event(LogLabel::ORDER_PAYMENT_LOG, ['payment_do_exception_msg' => $e->getMessage()]); throw new ErrorCodeException(ErrorCode::PAYMENT_FAIL, '[退款失败]'.$e->getMessage());