whitefang 1 anno fa
parent
commit
b79886fb50

+ 1 - 28
app/adminapi/logic/works/ServiceWorkLogic.php

@@ -263,6 +263,7 @@ class ServiceWorkLogic extends BaseLogic
             $work->work_total = $order_amount + $paid_order['paid_amount'];
             $work->work_images = $params['work_images'];
             $work->user_confirm_status = 1;//待确认报价
+            $work->price_approval = 0;
             $work->save();
 
             //添加变更日志
@@ -644,32 +645,4 @@ class ServiceWorkLogic extends BaseLogic
             return false;
         }
     }
-
-    /**
-     * @param $params
-     * @return bool
-     */
-    public static function submitChangePrice($params)
-    {
-        Db::startTrans();
-        try {
-            $serviceWork = ServiceWork::where('work_sn',$params['work_sn'])->findOrEmpty();
-            if($serviceWork->isEmpty()){
-                throw new \Exception('工单不存在');
-            }
-            $serviceWork->work_status = 4;
-            $serviceWork->user_confirm_status = 0;
-            $serviceWork->price_approval = 2;
-            $serviceWork->save();
-            Db::commit();
-            return true;
-        } catch (\Exception $e) {
-            Db::rollback();
-            self::setError($e->getMessage());
-            return false;
-        }
-    }
-
-
-
 }

+ 2 - 0
app/api/logic/ServiceOrderLogic.php

@@ -769,6 +769,8 @@ class ServiceOrderLogic extends BaseLogic
             if($work->isEmpty()){
                 throw new Exception('工单不存在');
             }
+            $work->work_status = 4;
+            $work->user_confirm_status = 0;
             $work->price_approval = 1;
             $work->save();
             Db::commit();

+ 0 - 19
app/workerapi/controller/WorksController.php

@@ -284,23 +284,4 @@ class WorksController extends BaseApiController
         ]);
         return $this->success('操作成功,已确定新的预约时间', [], 1, 1);
     }
-
-
-    /**
-     * 改价通知确认
-     * @return \think\response\Json
-     */
-    public function changePriceSubmitNotice()
-    {
-        $params = (new ServiceWorkValidate())->post()->goCheck('submitAppointment', [
-            'user_id' => $this->userId,
-            'user_info' => $this->userInfo
-        ]);
-        $result = ServiceWorkLogic::submitChangePrice($params);
-        if (false === $result) {
-            return $this->fail(ServiceWorkLogic::getError());
-        }
-        return $this->success('操作成功,重新开始报价', [], 1, 1);
-    }
-
 }