|
|
@@ -4,10 +4,14 @@ namespace app\api\controller\notify;
|
|
|
|
|
|
use app\adminapi\logic\works\ServiceWorkLogic;
|
|
|
use app\api\controller\BaseApiController;
|
|
|
+use app\api\logic\LoginLogic;
|
|
|
+use app\api\logic\ServiceOrderLogic;
|
|
|
use app\api\validate\UserConfirmValidate;
|
|
|
use app\common\enum\ThirdTypeEnum;
|
|
|
use app\common\logic\ThirdOrderLogic;
|
|
|
use app\common\model\master_worker\MasterWorker;
|
|
|
+use app\common\model\recharge\RechargeOrder;
|
|
|
+use app\common\model\user\User;
|
|
|
use app\common\model\works\ServiceWork;
|
|
|
use think\Exception;
|
|
|
use think\facade\Log;
|
|
|
@@ -48,4 +52,41 @@ class UserConfirmController extends BaseApiController
|
|
|
return $this->success('已确认上门');
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ public function confirmPriceDetail()
|
|
|
+ {
|
|
|
+ $params = (new UserConfirmValidate())->post()->goCheck('confirmDoor');
|
|
|
+ try {
|
|
|
+ $work_sn = decrypt($params['code'], \think\facade\Config::get('project.work_sn_key'));
|
|
|
+ $work = ServiceWork::where(['work_sn'=>$work_sn,'mobile'=>$params['phone']])->findOrEmpty();
|
|
|
+ if($work->isEmpty()){
|
|
|
+ throw new Exception('工单不存在');
|
|
|
+ }
|
|
|
+ // 先登录得到用户信息
|
|
|
+ $userInfo = LoginLogic::login(['account'=>$params['phone'],'scene'=>2,'terminal'=>2]);
|
|
|
+ $userId = User::where('mobile',$params['phone'])->value('id');
|
|
|
+ $sn = RechargeOrder::where('work_id',$work->id)->where('user_id',$work->user_id)->value('sn');
|
|
|
+ $result = ServiceOrderLogic::detail([
|
|
|
+ 'sn' => $sn,
|
|
|
+ 'user_id' => $userId,
|
|
|
+ 'user_info' => $userInfo,
|
|
|
+ 'domain'=>$this->request->domain()
|
|
|
+ ]);
|
|
|
+ if (false === $result) {
|
|
|
+ throw new Exception(ServiceOrderLogic::getError());
|
|
|
+ }
|
|
|
+ $result['user_info'] = $userInfo;
|
|
|
+ return $this->data($result);
|
|
|
+ }catch (\Exception $e){
|
|
|
+ return $this->fail($e->getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|