mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-02 23:27:04 +00:00
fix: 推送收到的群组名称为空的情况
This commit is contained in:
parent
3e19f3991c
commit
04bc5d7d17
@ -179,6 +179,23 @@ class WebSocketDialog extends AbstractModel
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取群组名称
|
||||
* @return mixed|string|null
|
||||
*/
|
||||
public function getGroupName()
|
||||
{
|
||||
$name = $this->name;
|
||||
if ($this->type == "group") {
|
||||
if ($this->group_type === 'project') {
|
||||
$name = \DB::table('projects')->where('dialog_id', $this->id)->value('name');
|
||||
} elseif ($this->group_type === 'task') {
|
||||
$name = \DB::table('project_tasks')->where('dialog_id', $this->id)->value('name');
|
||||
}
|
||||
}
|
||||
return $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送消息
|
||||
* @param $action
|
||||
|
||||
@ -84,7 +84,7 @@ class WebSocketDialogMsgTask extends AbstractTask
|
||||
// umeng推送app
|
||||
$msgTitle = User::userid2nickname($msg->userid);
|
||||
if ($dialog->type == 'group') {
|
||||
$msgTitle = "{$dialog->name} ($msgTitle)";
|
||||
$msgTitle = "{$dialog->getGroupName()} ($msgTitle)";
|
||||
}
|
||||
$umengMsg = new PushUmengMsg(array_keys($array), [
|
||||
'title' => $msgTitle,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user