|
@@ -994,4 +994,24 @@ class ServiceWorkLogic extends BaseLogic
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 上门码和完成码
|
|
|
|
|
+ * @param $params
|
|
|
|
|
+ * @return false|array
|
|
|
|
|
+ */
|
|
|
|
|
+ public static function confirmDoorCode($params)
|
|
|
|
|
+ {
|
|
|
|
|
+ try {
|
|
|
|
|
+ $work = ServiceWork::where(['master_worker_id'=>$params['user_id'],'work_sn'=>$params['work_sn']])->findOrEmpty();
|
|
|
|
|
+ if($work->isEmpty()){
|
|
|
|
|
+ throw new Exception('工单不存在');
|
|
|
|
|
+ }
|
|
|
|
|
+ $encryptedData = encrypt($params['work_sn'], \think\facade\Config::get('project.work_sn_key'));
|
|
|
|
|
+ return ['url'=>\think\facade\Config::get('project.user_website').'/service?code='.$encryptedData];
|
|
|
|
|
+ }catch (\Exception $e) {
|
|
|
|
|
+ self::setError($e->getMessage());
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|