|
...
|
...
|
@@ -225,23 +225,25 @@ class AsideTicketController extends BaseController |
|
|
|
*/
|
|
|
|
public function pushNotify($id)
|
|
|
|
{
|
|
|
|
$ticket = Tickets::find($id);
|
|
|
|
if (!$ticket) {
|
|
|
|
$this->response('工单不存在', Code::USER_MODEL_NOTFOUND_ERROE);
|
|
|
|
}
|
|
|
|
$project = TicketProject::find($id);
|
|
|
|
if (empty($project))
|
|
|
|
$this->response('工单项目不存在', Code::USER_MODEL_NOTFOUND_ERROE);
|
|
|
|
|
|
|
|
$project = $ticket->project;
|
|
|
|
if (empty($project->association)) {
|
|
|
|
$this->response('该工单没有绑定的企微群', Code::USER_MODEL_NOTFOUND_ERROE);
|
|
|
|
}
|
|
|
|
|
|
|
|
$ticket = Tickets::where('project_id', $project->id)
|
|
|
|
->orderBy('id', 'desc')
|
|
|
|
->first();
|
|
|
|
|
|
|
|
$message_push = new MessagePush();
|
|
|
|
$message_push->project_id = $project->table_id;
|
|
|
|
$message_push->friend_id = $project->association->friend_id;
|
|
|
|
$message_push->content_type = 'Link';
|
|
|
|
$message_push->content = json_encode([
|
|
|
|
'title' => '工单查看 - ' . $project->company_name,
|
|
|
|
'desc' => $ticket->title,
|
|
|
|
'desc' => $ticket ? $ticket->title : "工单列表",
|
|
|
|
'size' => 0,
|
|
|
|
'thumbSize' => 0,
|
|
|
|
'thumbUrl' => 'https://oa.quanqiusou.cn/logo.ico',
|
...
|
...
|
|