|
@@ -9,6 +9,7 @@ use App\Services\BaseService; |
|
@@ -9,6 +9,7 @@ use App\Services\BaseService; |
|
9
|
use Illuminate\Database\Eloquent\Builder;
|
9
|
use Illuminate\Database\Eloquent\Builder;
|
|
10
|
use Illuminate\Database\Eloquent\Model;
|
10
|
use Illuminate\Database\Eloquent\Model;
|
|
11
|
use Illuminate\Support\Facades\DB;
|
11
|
use Illuminate\Support\Facades\DB;
|
|
|
|
12
|
+use Illuminate\Support\Facades\Http;
|
|
12
|
|
13
|
|
|
13
|
class ProjectAssociationServices extends BaseService
|
14
|
class ProjectAssociationServices extends BaseService
|
|
14
|
{
|
15
|
{
|
|
@@ -151,4 +152,45 @@ class ProjectAssociationServices extends BaseService |
|
@@ -151,4 +152,45 @@ class ProjectAssociationServices extends BaseService |
|
151
|
];
|
152
|
];
|
|
152
|
return $result;
|
153
|
return $result;
|
|
153
|
}
|
154
|
}
|
|
|
|
155
|
+
|
|
|
|
156
|
+ /**
|
|
|
|
157
|
+ * 获取AI客服列表
|
|
|
|
158
|
+ * @author zbj
|
|
|
|
159
|
+ * @date 2024/9/7
|
|
|
|
160
|
+ */
|
|
|
|
161
|
+ public function getWorkChatRoomList($search = ''){
|
|
|
|
162
|
+ $param = [
|
|
|
|
163
|
+ 'search' => $search,
|
|
|
|
164
|
+ 'time' => time(),
|
|
|
|
165
|
+ ];
|
|
|
|
166
|
+ $param['sign'] = $this->getSign($param);
|
|
|
|
167
|
+ $url = 'https://hub.ai.cc/api/globalso_ai_customer_service/chatroom_list';
|
|
|
|
168
|
+ $result = Http::withoutVerifying()->post($url, $param)->json();
|
|
|
|
169
|
+ if(empty($result) || $result['status'] != 200){
|
|
|
|
170
|
+ return [];
|
|
|
|
171
|
+ }
|
|
|
|
172
|
+ return $result['data'];
|
|
|
|
173
|
+ }
|
|
|
|
174
|
+
|
|
|
|
175
|
+ /**
|
|
|
|
176
|
+ * @param $data
|
|
|
|
177
|
+ * @return string
|
|
|
|
178
|
+ */
|
|
|
|
179
|
+ public function getSign($data)
|
|
|
|
180
|
+ {
|
|
|
|
181
|
+ if (empty($data) || FALSE == is_array($data))
|
|
|
|
182
|
+ return '';
|
|
|
|
183
|
+ unset($data['sign']);
|
|
|
|
184
|
+ ksort($data);
|
|
|
|
185
|
+ // 放弃http_build_query 会将空数据字段抛弃
|
|
|
|
186
|
+ // $string = http_build_query($data);
|
|
|
|
187
|
+ $tem = [];
|
|
|
|
188
|
+ foreach ($data as $key => $val) {
|
|
|
|
189
|
+ $tem[] = $key . '=' . urlencode($val);
|
|
|
|
190
|
+ }
|
|
|
|
191
|
+ $string = implode('&', $tem);
|
|
|
|
192
|
+ $key = md5('quanqiusou.com');
|
|
|
|
193
|
+ $sign = md5($string . $key);
|
|
|
|
194
|
+ return $sign;
|
|
|
|
195
|
+ }
|
|
154
|
} |
196
|
} |