|
...
|
...
|
@@ -9,6 +9,7 @@ use App\Services\BaseService; |
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
use Illuminate\Support\Facades\Http;
|
|
|
|
|
|
|
|
class ProjectAssociationServices extends BaseService
|
|
|
|
{
|
|
...
|
...
|
@@ -151,4 +152,45 @@ class ProjectAssociationServices extends BaseService |
|
|
|
];
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取AI客服列表
|
|
|
|
* @author zbj
|
|
|
|
* @date 2024/9/7
|
|
|
|
*/
|
|
|
|
public function getWorkChatRoomList($search = ''){
|
|
|
|
$param = [
|
|
|
|
'search' => $search,
|
|
|
|
'time' => time(),
|
|
|
|
];
|
|
|
|
$param['sign'] = $this->getSign($param);
|
|
|
|
$url = 'https://hub.ai.cc/api/globalso_ai_customer_service/chatroom_list';
|
|
|
|
$result = Http::withoutVerifying()->post($url, $param)->json();
|
|
|
|
if(empty($result) || $result['status'] != 200){
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
return $result['data'];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $data
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getSign($data)
|
|
|
|
{
|
|
|
|
if (empty($data) || FALSE == is_array($data))
|
|
|
|
return '';
|
|
|
|
unset($data['sign']);
|
|
|
|
ksort($data);
|
|
|
|
// 放弃http_build_query 会将空数据字段抛弃
|
|
|
|
// $string = http_build_query($data);
|
|
|
|
$tem = [];
|
|
|
|
foreach ($data as $key => $val) {
|
|
|
|
$tem[] = $key . '=' . urlencode($val);
|
|
|
|
}
|
|
|
|
$string = implode('&', $tem);
|
|
|
|
$key = md5('quanqiusou.com');
|
|
|
|
$sign = md5($string . $key);
|
|
|
|
return $sign;
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|