外呼
This commit is contained in:
30
app/api/controller/Hujiao.php
Normal file
30
app/api/controller/Hujiao.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\api\model\User;
|
||||
use app\manager\model\FollowRecord;
|
||||
|
||||
class Hujiao
|
||||
{
|
||||
public function callback() {
|
||||
$data = json_decode(file_get_contents("php://input"), true);
|
||||
|
||||
$telstarttime = $data['starttime'];
|
||||
$druation = $data['druation'];
|
||||
|
||||
$follow_model = new FollowRecord;
|
||||
$user_model = new User;
|
||||
|
||||
$user_info = $user_model->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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user