Преглед изворни кода

Merge branch 'master' of e.coding.net:zdap/weixiu/weixiu_api into 1025-m

liugc пре 1 година
родитељ
комит
630d4cb4b8

+ 12 - 0
app/api/controller/ServiceOrderController.php

@@ -40,6 +40,18 @@ class ServiceOrderController extends BaseApiController
         return $this->data($result);
     }
 
+    public function getDetailStatus()
+    {
+        $params = (new ServiceOrderValidate())->goCheck('detail',[
+            'user_id' => $this->userId,
+        ]);
+        $result = ServiceOrderLogic::getDetailStatus($params);
+        if (false === $result) {
+            return $this->fail(ServiceOrderLogic::getError());
+        }
+        return $this->data($result);
+    }
+
     /**
      * 订单支付详情
      * @return \think\response\Json

+ 24 - 1
app/api/logic/ServiceOrderLogic.php

@@ -402,7 +402,7 @@ class ServiceOrderLogic extends BaseLogic
             $order_info =  \app\common\model\recharge\RechargeOrder::with(['order_goods'=>function ($query) {
                 $query->visible(['goods_name','goods_image','goods_number','good_unit']);
             },'service_work'=>function ($query) {
-                $query->visible(['work_sn','real_name','mobile','address','service_status','appointment_time','master_worker_id','work_images','finished_images','finished_time','spare_total','service_work_spare_id'])->append(['service_status_text','user_service_status','user_service_status_text']);
+                $query->visible(['work_sn','real_name','mobile','address','service_status','appointment_time','master_worker_id','work_images','finished_images','finished_time','spare_total','service_work_spare_id','refund_approval'])->append(['service_status_text','user_service_status','user_service_status_text']);
             }])
                 ->visible(['id','sn','payment_type','order_total','order_amount','paid_amount','pay_status','create_time','title','work_id'])
                 ->where([
@@ -523,6 +523,29 @@ class ServiceOrderLogic extends BaseLogic
             }
     }
 
+    public static function getDetailStatus($params)
+    {
+        try {
+            $order_info =  \app\common\model\recharge\RechargeOrder::with(['service_work'=>function ($query) {
+                $query->visible(['work_sn'])->append(['service_status_text','user_service_status','user_service_status_text']);
+            }])
+                ->visible(['id','sn'])
+                ->where([
+                    'order_type' => 0,
+                    'user_id' => $params['user_id'],
+                    'sn'=>$params['sn']
+                ])->findOrEmpty()->toArray();
+            if(empty($order_info)){
+                throw new Exception('订单不存在');
+            }
+            return $order_info;
+        }
+        catch (\Exception $e) {
+            self::setError($e->getMessage());
+            return false;
+        }
+    }
+
 
     /**
      * 获取订单支付详情

+ 7 - 0
app/workerapi/validate/BankAccountValidate.php

@@ -16,6 +16,7 @@ class BankAccountValidate extends BaseValidate
         'opening_branch'=>'require',
         'account'=>'require',
         'mobile'=>'require|mobile',
+        'bank_image'=>'require'
     ];
 
     protected $message = [
@@ -27,5 +28,11 @@ class BankAccountValidate extends BaseValidate
         'account.require' => '请输入开发支行',
         'mobile.require' => '请输入银行卡预留手机号',
         'mobile.mobile' => '银行卡预留手机号格式不正确',
+        'bank_image.require' => '请上传银行卡照片',
     ];
+
+    public function sceneBindBankAccount()
+    {
+        $this->only(['account_holder','bank_name','province','city','opening_branch','account','mobile','bank_image']);
+    }
 }