mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-25 10:50:27 +00:00
feat: 更新 Manticore 数据库插入逻辑,添加 userid 和 tags 字段;在 WebSocket 消息删除时同步 Manticore
This commit is contained in:
parent
a95f22bf42
commit
31045b3808
@ -2027,13 +2027,14 @@ class ManticoreBase
|
|||||||
|
|
||||||
// 重新插入(包含向量)
|
// 重新插入(包含向量)
|
||||||
$sql = "INSERT INTO task_vectors
|
$sql = "INSERT INTO task_vectors
|
||||||
(id, task_id, project_id, visibility, task_name, task_desc, task_content, allowed_users, content_vector)
|
(id, task_id, project_id, userid, visibility, task_name, task_desc, task_content, allowed_users, content_vector)
|
||||||
VALUES (?, ?, ?, ?, ?, ?, ?, {$allowedUsersStr}, {$vectorStr})";
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, {$allowedUsersStr}, {$vectorStr})";
|
||||||
|
|
||||||
return $instance->execute($sql, [
|
return $instance->execute($sql, [
|
||||||
$existing['id'],
|
$existing['id'],
|
||||||
$existing['task_id'],
|
$existing['task_id'],
|
||||||
$existing['project_id'],
|
$existing['project_id'],
|
||||||
|
$existing['userid'] ?? 0,
|
||||||
$existing['visibility'] ?? 1,
|
$existing['visibility'] ?? 1,
|
||||||
$existing['task_name'],
|
$existing['task_name'],
|
||||||
$existing['task_desc'],
|
$existing['task_desc'],
|
||||||
@ -2079,12 +2080,14 @@ class ManticoreBase
|
|||||||
|
|
||||||
// 重新插入(包含向量)
|
// 重新插入(包含向量)
|
||||||
$sql = "INSERT INTO project_vectors
|
$sql = "INSERT INTO project_vectors
|
||||||
(id, project_id, project_name, project_desc, allowed_users, content_vector)
|
(id, project_id, userid, personal, project_name, project_desc, allowed_users, content_vector)
|
||||||
VALUES (?, ?, ?, ?, {$allowedUsersStr}, {$vectorStr})";
|
VALUES (?, ?, ?, ?, ?, ?, {$allowedUsersStr}, {$vectorStr})";
|
||||||
|
|
||||||
return $instance->execute($sql, [
|
return $instance->execute($sql, [
|
||||||
$existing['id'],
|
$existing['id'],
|
||||||
$existing['project_id'],
|
$existing['project_id'],
|
||||||
|
$existing['userid'] ?? 0,
|
||||||
|
$existing['personal'] ?? 0,
|
||||||
$existing['project_name'],
|
$existing['project_name'],
|
||||||
$existing['project_desc'],
|
$existing['project_desc'],
|
||||||
]);
|
]);
|
||||||
@ -2123,8 +2126,8 @@ class ManticoreBase
|
|||||||
|
|
||||||
// 重新插入(包含向量)
|
// 重新插入(包含向量)
|
||||||
$sql = "INSERT INTO user_vectors
|
$sql = "INSERT INTO user_vectors
|
||||||
(id, userid, nickname, email, profession, introduction, content_vector)
|
(id, userid, nickname, email, profession, tags, introduction, content_vector)
|
||||||
VALUES (?, ?, ?, ?, ?, ?, {$vectorStr})";
|
VALUES (?, ?, ?, ?, ?, ?, ?, {$vectorStr})";
|
||||||
|
|
||||||
return $instance->execute($sql, [
|
return $instance->execute($sql, [
|
||||||
$existing['id'],
|
$existing['id'],
|
||||||
@ -2132,6 +2135,7 @@ class ManticoreBase
|
|||||||
$existing['nickname'],
|
$existing['nickname'],
|
||||||
$existing['email'],
|
$existing['email'],
|
||||||
$existing['profession'],
|
$existing['profession'],
|
||||||
|
$existing['tags'] ?? '',
|
||||||
$existing['introduction'],
|
$existing['introduction'],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,6 +70,9 @@ class WebSocketDialogMsgObserver extends AbstractObserver
|
|||||||
*/
|
*/
|
||||||
public function forceDeleted(WebSocketDialogMsg $webSocketDialogMsg)
|
public function forceDeleted(WebSocketDialogMsg $webSocketDialogMsg)
|
||||||
{
|
{
|
||||||
//
|
// Manticore 删除
|
||||||
|
if (Apps::isInstalled('manticore')) {
|
||||||
|
self::taskDeliver(new ManticoreSyncTask('msg_delete', ['msg_id' => $webSocketDialogMsg->id]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user