perf: 显示待办消息数量

This commit is contained in:
kuaifan
2022-07-08 14:00:16 +08:00
parent 6412efd031
commit 883e5c26d9
7 changed files with 41 additions and 16 deletions

View File

@@ -81,7 +81,7 @@ class WebSocketDialog extends AbstractModel
$builder = WebSocketDialogUser::whereDialogId($this->id);
$this->people = $builder->count();
// 有待办
$this->has_todo = WebSocketDialogMsgTodo::whereDialogId($this->id)->whereUserid($userid)->whereDoneAt(null)->exists();
$this->todo_num = WebSocketDialogMsgTodo::whereDialogId($this->id)->whereUserid($userid)->whereDoneAt(null)->count();
}
// 对方信息
$this->dialog_user = null;