Jelajahi Sumber

修改人工充值

lip 3 jam lalu
induk
melakukan
ec6f0f1104

+ 1 - 1
app/Http/Controllers/admin/PaymentOrder.php

@@ -60,7 +60,7 @@ class PaymentOrder extends Controller
             $remark = $params['remark'] ?? '';
             $info = PaymentOrderModel::find($params['id']);
             if (!$info) throw new Exception('数据不存在', HttpStatus::CUSTOM_ERROR);
-            if ($info->status != 1) throw new Exception('数据已处理', HttpStatus::CUSTOM_ERROR);
+            if ($info->status != 4) throw new Exception('用户未提交充值凭证', HttpStatus::CUSTOM_ERROR);
             if ($info->payment_type == 0) throw new Exception('当前订单非人工充值,无法操作', HttpStatus::CUSTOM_ERROR);
             if ($params['status'] == 3) {
                 if (empty($remark)) {

+ 1 - 0
app/Http/Controllers/api/Wallet.php

@@ -197,6 +197,7 @@ class Wallet extends BaseController
                 return $this->error(lang('待处理中,请稍后'));
             }
             $info->image = $params['image'];
+            $info->status = PaymentOrderService::STATUS_USER;
             $info->save();
             return $this->success($info,'提交成功,请等待人工审核');
         } catch (ValidationException $e) {

+ 1 - 0
app/Services/PaymentOrderService.php

@@ -24,6 +24,7 @@ class PaymentOrderService extends BaseService
     const STATUS_PROCESS = 1; // 处理中
     const STATUS_SUCCESS = 2; // 成功
     const STATUS_FAIL = 3; // 失败
+    const STATUS_USER = 4; // 待用户提交凭证
 
     public static string $MODEL = PaymentOrder::class;