瀏覽代碼

工程师后台弹框改约列表和确认改约

whitefang 1 年之前
父節點
當前提交
3409a50fc6

+ 7 - 7
app/adminapi/logic/works/ServiceWorkLogic.php

@@ -156,11 +156,6 @@ class ServiceWorkLogic extends BaseLogic
                 throw new Exception('工单不存在');
             }
 
-            $order = RechargeOrder::where(['sn'=>$params['order_sn'],'work_id'=>$work['id']])->findOrEmpty();
-            if($order->isEmpty()){
-                throw new Exception('订单不存在');
-            }
-
             if($work->work_status != 3){
                 throw new Exception('请勿重复点击');
             }
@@ -498,7 +493,7 @@ class ServiceWorkLogic extends BaseLogic
 
     public static function getDetailWorkServiceStatus($params)
     {
-        $result = ServiceWork::where('id',$params['id'])->field('work_status,user_confirm_status,appointment_time')->findOrEmpty()->toArray();
+        $result = ServiceWork::where('id',$params['id'])->field('work_status,user_confirm_status,appointment_time,price_approval,appoint_approval')->findOrEmpty()->toArray();
         //工程师工单按钮状态
         $work_service_status = 0;
         //工单状态
@@ -538,7 +533,7 @@ class ServiceWorkLogic extends BaseLogic
         if($result['work_status'] ==9){
             $work_service_status = 12;
         }
-        return ['work_service_status'=>$work_service_status];
+        return ['work_service_status'=>$work_service_status,'price_approval'=>$result['price_approval'],'appoint_approval'=>$result['appoint_approval']];
     }
 
     /**
@@ -650,6 +645,11 @@ class ServiceWorkLogic extends BaseLogic
         }
     }
 
+    public static function submitChangePrice()
+    {
+
+    }
+
 
 
 }

+ 7 - 17
app/workerapi/controller/WorksController.php

@@ -277,32 +277,22 @@ class WorksController extends BaseApiController
         return $this->success('操作成功,已确定新的预约时间', [], 1, 1);
     }
 
+
     /**
-     * 改价通知提醒
+     * 改价通知确认
      * @return \think\response\Json
      */
-    public function ChangePriceNotice()
+    public function ChangePriceSubmitNotice()
     {
-        $params = (new ServiceWorkValidate())->goCheck('detail',[
+        $params = (new ServiceWorkValidate())->post()->goCheck('submitAppointment', [
             'user_id' => $this->userId,
+            'user_info' => $this->userInfo
         ]);
-        if(empty($params['id']) && empty($params['work_sn'])){
-            $this->fail('参数错误');
-        }
-        $result = ServiceWorkLogic::detail($params);
+        $result = ServiceWorkLogic::submitChangePrice($params);
         if (false === $result) {
             return $this->fail(ServiceWorkLogic::getError());
         }
-        return $this->data($result);
-    }
-
-    /**
-     * 改价通知确认
-     * @return \think\response\Json
-     */
-    public function ChangePriceSubmitNotice()
-    {
-
+        return $this->success('操作成功,已确定新的预约时间', [], 1, 1);
     }
 
 }

+ 1 - 1
app/workerapi/validate/ServiceWorkValidate.php

@@ -103,7 +103,7 @@ class ServiceWorkValidate extends BaseValidate
      */
     public function sceneDoor()
     {
-        return $this->only(['work_sn','order_sn']);
+        return $this->only(['work_sn']);
     }
 
     public function scenePrice()