|
...
|
...
|
@@ -158,26 +158,29 @@ class TicketController extends BaseController |
|
|
|
* 企微群里@小超或艾丝,触发推送工单
|
|
|
|
* 接收群ID
|
|
|
|
*/
|
|
|
|
public function pushNotifyByBot($friend_id)
|
|
|
|
public function pushTicketByBot($friend_id)
|
|
|
|
{
|
|
|
|
$project = TicketProject::where('wechat_group_id', $friend_id)->where('is_del', 0)->first();
|
|
|
|
if (!$project)
|
|
|
|
return response()->json(['message' => '未找到对应的工单项目'], 404);
|
|
|
|
|
|
|
|
$url = in_array($project->project_cate, [3,4]) ? 'https://hub.ai.cc/api/fob_ai_customer_service/push_message' : 'https://hub.ai.cc/api/globalso_ai_customer_service/send_msg';
|
|
|
|
$response = Http::post($url, [
|
|
|
|
'type' => 'Link',
|
|
|
|
'friend_id' => $friend_id,
|
|
|
|
'content' => json_encode([
|
|
|
|
'title' => 'AI协同工单 - ' . $project->company_name,
|
|
|
|
'desc' => "您好,我们同事没有及时回复,你可以查看工单进度!",
|
|
|
|
'size' => 0,
|
|
|
|
'thumbSize' => 0,
|
|
|
|
'thumbUrl' => 'https://hub.globalso.com/logocm.png',
|
|
|
|
'url' => 'https://oa.quanqiusou.cn/afterorder?project_id='.$project->uuid
|
|
|
|
], JSON_UNESCAPED_UNICODE)
|
|
|
|
]);
|
|
|
|
// 返回 $response 的相应内容以及网络状态码
|
|
|
|
return response($response->body(), $response->status());
|
|
|
|
// $url = in_array($project->project_cate, [3,4]) ? 'https://hub.ai.cc/api/fob_ai_customer_service/push_message' : 'https://hub.ai.cc/api/globalso_ai_customer_service/send_msg';
|
|
|
|
// $response = Http::post($url, [
|
|
|
|
// 'type' => 'Link',
|
|
|
|
// 'friend_id' => $friend_id,
|
|
|
|
// 'content' => json_encode([
|
|
|
|
// 'title' => 'AI协同工单 - ' . $project->company_name,
|
|
|
|
// 'desc' => "您好,我们同事没有及时回复,你可以查看工单进度!",
|
|
|
|
// 'size' => 0,
|
|
|
|
// 'thumbSize' => 0,
|
|
|
|
// 'thumbUrl' => 'https://hub.globalso.com/logocm.png',
|
|
|
|
// 'url' => 'https://oa.quanqiusou.cn/afterorder?project_id='.$project->uuid
|
|
|
|
// ], JSON_UNESCAPED_UNICODE)
|
|
|
|
// ]);
|
|
|
|
// // 返回 $response 的相应内容以及网络状态码
|
|
|
|
// return response($response->body(), $response->status());
|
|
|
|
|
|
|
|
$project->pushWechatGroupMsg("您好,我们同事没有及时回复,你可以查看工单进度!");
|
|
|
|
return response()->json(['message' => '工单推送成功']);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|