From ea2fb7b3180297f7348208cf69e69fe869fff693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwanyongkang=E2=80=9D?= <“937888580@qq.com”> Date: Wed, 13 Sep 2023 18:14:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=96=E5=91=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Hujiao.php | 30 ++++++++++++++ app/manager/controller/UserFollow.php | 60 +++++++++++++++++++++++---- 2 files changed, 83 insertions(+), 7 deletions(-) create mode 100644 app/api/controller/Hujiao.php diff --git a/app/api/controller/Hujiao.php b/app/api/controller/Hujiao.php new file mode 100644 index 0000000..342034d --- /dev/null +++ b/app/api/controller/Hujiao.php @@ -0,0 +1,30 @@ +getOne(['LoginCode' => $data['telB']],'Id,ManagerId'); + + $add_data = [ + 'user_id' => $user_info['Id'], + 'op_user' => $user_info['ManagerId'], + 'telstarttime' => $telstarttime, + 'druation' => $druation.'s', + ]; + + $follow_model->add($add_data); + } +} diff --git a/app/manager/controller/UserFollow.php b/app/manager/controller/UserFollow.php index 88b7642..1730bd7 100644 --- a/app/manager/controller/UserFollow.php +++ b/app/manager/controller/UserFollow.php @@ -5,7 +5,7 @@ * @Author: kangkang * @Date: 2020-10-13 19:52:37 * @LastEditors: “wanyongkang” “937888580@qq.com” - * @LastEditTime: 2023-08-10 16:41:56 + * @LastEditTime: 2023-09-13 18:13:57 */ namespace app\manager\controller; @@ -390,12 +390,19 @@ class UserFollow extends Controller $user_model->updateOne(['Id' => $data['user_id']], ['follow_status' => $data['status']]); $follow_rcord->updateOne(['user_id' => $data['user_id']], ['active' => 0]); $info = []; - $info['user_id'] = $data['user_id']; - $info['op_user'] = $this->userinfo['OperaterID']; - $info['follow_status'] = $data['status']; - $info['record'] = $data['old_status'] . '=>' . $user_enum::$FollowStatus[$data['status']]; - $info['remark'] = $data['remark']; - $follow_rcord->add($info); + if (empty($data['id'])) { + $info['user_id'] = $data['user_id']; + $info['op_user'] = $this->userinfo['OperaterID']; + $info['follow_status'] = $data['status']; + $info['record'] = $data['old_status'] . '=>' . $user_enum::$FollowStatus[$data['status']]; + $info['remark'] = $data['remark']; + $follow_rcord->add($info); + } else { + $info['follow_status'] = $data['status']; + $info['record'] = $data['old_status'] . '=>' . $user_enum::$FollowStatus[$data['status']]; + $info['remark'] = $data['remark']; + $follow_rcord->updateOne(['id' => $data['id']],$info); + } \result(); } @@ -487,4 +494,43 @@ class UserFollow extends Controller $product_account_model = new ProductAccount; \result($product_account_model->getUserAccount($id, $index)); } + + //拨打电话进行维护 + public function hujiao() { + $data = json_decode(file_get_contents("php://input"), true); + $phone = $data['phone']; + + $callers = ['1017'=>'13523072998','1029'=>'15713870747']; + + $caller = $callers[$this->userinfo['OperaterID']]; + + $callee = $phone; + $serviceNumber = '02361933764'; + die; + + $header = [ + 'Content-Type:application/json', + 'app_id:f39b78fb812f192e221b55b752267b2c', + 'timeStamp:'. time() * 1000 + ]; + + + $param = [ + 'caller' =>$caller, + 'callee'=>$callee, + 'serviceNumber'=>$serviceNumber, + 'callBackUrl' =>"http://localhost/callback" + + ]; + + + $back_data = json_decode(linkcurl('https://yunyuzhineng.cn:8888/voice/v1/call-rs','POST',json_encode($param),$header,0)); + + if ($back_data->code == 1000) { + \result([],'呼叫成功'); + } else { + \result([],'呼叫失败',30000); + } + + } }