|
|
@@ -1,6 +1,7 @@
|
|
|
<?php
|
|
|
namespace app\api\controller;
|
|
|
|
|
|
+use app\adminapi\logic\master_worker\MasterWorkerLogic;
|
|
|
use app\adminapi\logic\works\ServiceWorkLogic;
|
|
|
use app\api\lists\recharge\ServiceOrderLists;
|
|
|
use app\api\logic\ServiceOrderLogic;
|
|
|
@@ -12,6 +13,8 @@ use think\facade\Log;
|
|
|
*/
|
|
|
class ServiceOrderController extends BaseApiController
|
|
|
{
|
|
|
+
|
|
|
+ public array $notNeedLogin = ['approvalChangeAppointment'];
|
|
|
/**
|
|
|
* 订单列表
|
|
|
* @return \think\response\Json
|
|
|
@@ -239,13 +242,37 @@ class ServiceOrderController extends BaseApiController
|
|
|
public function approvalChangeAppointment()
|
|
|
{
|
|
|
$params = (new ServiceOrderValidate())->post()->goCheck('changeAppointment', [
|
|
|
- 'user_id' => $this->userId,
|
|
|
+ 'user_id' => 1,
|
|
|
'user_info' => $this->userInfo
|
|
|
]);
|
|
|
$result = ServiceOrderLogic::approvalChangeAppointment($params);
|
|
|
if (false === $result) {
|
|
|
return $this->fail(ServiceOrderLogic::getError());
|
|
|
}
|
|
|
+ $order = ServiceOrderLogic::orderPayInfo($params);
|
|
|
+ $workDetail = ServiceWorkLogic::detail(['id'=>$order['work_id']]);
|
|
|
+ $masterDetail = MasterWorkerLogic::detail(['id'=>$workDetail['master_worker_id']]);
|
|
|
+ // 修改预约时间通知【给用户的通知】
|
|
|
+ $res = event('Notice', [
|
|
|
+ 'scene_id' => 117,
|
|
|
+ 'params' => [
|
|
|
+ 'user_id' => $workDetail['user_id'],
|
|
|
+ 'date' => $params['appointment_time'],
|
|
|
+ 'tel' => $masterDetail['mobile'],
|
|
|
+ ]
|
|
|
+ ]);
|
|
|
+ // 修改预约时间通知【给工程师的通知,仅限公众号】
|
|
|
+ $res = event('Notice', [
|
|
|
+ 'scene_id' => 118,
|
|
|
+ 'params' => [
|
|
|
+ 'user_id' => $workDetail['master_worker_id'],
|
|
|
+ 'thing4' => $workDetail['title'],
|
|
|
+ 'time5' => $workDetail['appointment_time'],
|
|
|
+ 'time6' => $params['appointment_time'],
|
|
|
+ 'thing11' => $workDetail['address'],
|
|
|
+ 'phone_number8' => $workDetail['mobile'],
|
|
|
+ ]
|
|
|
+ ]);
|
|
|
return $this->success('已提交改约', [], 1, 1);
|
|
|
}
|
|
|
|