no message
This commit is contained in:
parent
f2b32c2161
commit
7ed30309cd
@ -128,7 +128,7 @@ class DialogController extends AbstractController
|
||||
*/
|
||||
public function msg__unread()
|
||||
{
|
||||
$unread = WebSocketDialogMsgRead::whereUserid(User::token2userid())->whereReadAt(null)->count();
|
||||
$unread = WebSocketDialogMsgRead::whereUserid(User::userid())->whereReadAt(null)->count();
|
||||
return Base::retSuccess('success', [
|
||||
'unread' => $unread,
|
||||
]);
|
||||
|
@ -213,14 +213,14 @@ class SystemController extends AbstractController
|
||||
*/
|
||||
public function imgupload()
|
||||
{
|
||||
if (User::token2userid() === 0) {
|
||||
if (User::userid() === 0) {
|
||||
return Base::retError('身份失效,等重新登录');
|
||||
}
|
||||
$scale = [intval(Request::input('width')), intval(Request::input('height'))];
|
||||
if (!$scale[0] && !$scale[1]) {
|
||||
$scale = [2160, 4160, -1];
|
||||
}
|
||||
$path = "uploads/picture/" . User::token2userid() . "/" . date("Ym") . "/";
|
||||
$path = "uploads/picture/" . User::userid() . "/" . date("Ym") . "/";
|
||||
$image64 = trim(Base::getPostValue('image64'));
|
||||
$fileName = trim(Base::getPostValue('filename'));
|
||||
if ($image64) {
|
||||
@ -262,10 +262,10 @@ class SystemController extends AbstractController
|
||||
*/
|
||||
public function imgview()
|
||||
{
|
||||
if (User::token2userid() === 0) {
|
||||
if (User::userid() === 0) {
|
||||
return Base::retError('身份失效,等重新登录');
|
||||
}
|
||||
$publicPath = "uploads/picture/" . User::token2userid() . "/";
|
||||
$publicPath = "uploads/picture/" . User::userid() . "/";
|
||||
$dirPath = public_path($publicPath);
|
||||
$dirs = $files = [];
|
||||
//
|
||||
@ -360,10 +360,10 @@ class SystemController extends AbstractController
|
||||
*/
|
||||
public function fileupload()
|
||||
{
|
||||
if (User::token2userid() === 0) {
|
||||
if (User::userid() === 0) {
|
||||
return Base::retError('身份失效,等重新登录');
|
||||
}
|
||||
$path = "uploads/files/" . User::token2userid() . "/" . date("Ym") . "/";
|
||||
$path = "uploads/files/" . User::userid() . "/" . date("Ym") . "/";
|
||||
$image64 = trim(Base::getPostValue('image64'));
|
||||
$fileName = trim(Base::getPostValue('filename'));
|
||||
if ($image64) {
|
||||
|
@ -35,7 +35,7 @@ class InvokeController extends BaseController
|
||||
// 使用websocket请求
|
||||
$apiWebsocket = Request::header('Api-Websocket');
|
||||
if ($apiWebsocket) {
|
||||
$userid = User::token2userid();
|
||||
$userid = User::userid();
|
||||
if ($userid > 0) {
|
||||
$url = 'http://127.0.0.1:' . env('LARAVELS_LISTEN_PORT') . Request::getRequestUri();
|
||||
$task = new IhttpTask($url, Request::post(), [
|
||||
|
@ -19,6 +19,7 @@ use Request;
|
||||
* @property int|null $userid 创建人
|
||||
* @property int|mixed $dialog_id 聊天会话ID
|
||||
* @property string|null $archived_at 归档时间
|
||||
* @property int|null $archived_userid 归档会员
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @property \Illuminate\Support\Carbon|null $deleted_at
|
||||
@ -41,6 +42,7 @@ use Request;
|
||||
* @method static \Illuminate\Database\Query\Builder|Project onlyTrashed()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Project query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Project whereArchivedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Project whereArchivedUserid($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Project whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Project whereDeletedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Project whereDesc($value)
|
||||
@ -84,8 +86,8 @@ class Project extends AbstractModel
|
||||
$this->appendattrs['task_percent'] = $this->appendattrs['task_num'] ? intval($this->appendattrs['task_complete'] / $this->appendattrs['task_num'] * 100) : 0;
|
||||
//
|
||||
$builder = ProjectTask::whereProjectId($this->id)->whereParentId(0)->whereNull('archived_at');
|
||||
$this->appendattrs['task_my_num'] = $builder->whereUserid(User::token2userid())->count();
|
||||
$this->appendattrs['task_my_complete'] = $builder->whereUserid(User::token2userid())->whereNotNull('complete_at')->count();
|
||||
$this->appendattrs['task_my_num'] = $builder->whereUserid(User::userid())->count();
|
||||
$this->appendattrs['task_my_complete'] = $builder->whereUserid(User::userid())->whereNotNull('complete_at')->count();
|
||||
$this->appendattrs['task_my_percent'] = $this->appendattrs['task_my_num'] ? intval($this->appendattrs['task_my_complete'] / $this->appendattrs['task_my_num'] * 100) : 0;
|
||||
}
|
||||
}
|
||||
@ -299,6 +301,7 @@ class Project extends AbstractModel
|
||||
} else {
|
||||
// 归档任务
|
||||
$this->archived_at = $archived_at;
|
||||
$this->archived_userid = User::userid();
|
||||
$this->addLog("项目归档");
|
||||
$this->pushMsg('archived');
|
||||
}
|
||||
@ -337,7 +340,7 @@ class Project extends AbstractModel
|
||||
'project_id' => $this->id,
|
||||
'column_id' => 0,
|
||||
'task_id' => 0,
|
||||
'userid' => $userid ?: User::token2userid(),
|
||||
'userid' => $userid ?: User::userid(),
|
||||
'detail' => $detail,
|
||||
]);
|
||||
$log->save();
|
||||
|
@ -92,7 +92,7 @@ class ProjectColumn extends AbstractModel
|
||||
'project_id' => $this->project_id,
|
||||
'column_id' => $this->id,
|
||||
'task_id' => 0,
|
||||
'userid' => $userid ?: User::token2userid(),
|
||||
'userid' => $userid ?: User::userid(),
|
||||
'detail' => $detail,
|
||||
]);
|
||||
$log->save();
|
||||
|
@ -26,6 +26,7 @@ use Request;
|
||||
* @property string|null $start_at 计划开始时间
|
||||
* @property string|null $end_at 计划结束时间
|
||||
* @property string|null $archived_at 归档时间
|
||||
* @property int|null $archived_userid 归档会员
|
||||
* @property string|null $complete_at 完成时间
|
||||
* @property int|null $userid 创建人
|
||||
* @property int|null $p_level 优先级
|
||||
@ -57,6 +58,7 @@ use Request;
|
||||
* @method static \Illuminate\Database\Query\Builder|ProjectTask onlyTrashed()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTask query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTask whereArchivedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTask whereArchivedUserid($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTask whereColor($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTask whereColumnId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTask whereCompleteAt($value)
|
||||
@ -325,12 +327,12 @@ class ProjectTask extends AbstractModel
|
||||
}
|
||||
}
|
||||
// 负责人
|
||||
$owner = intval($owner) ?: User::token2userid();
|
||||
$owner = intval($owner) ?: User::userid();
|
||||
if (!ProjectUser::whereProjectId($project_id)->whereUserid($owner)->exists()) {
|
||||
throw new ApiException($retPre . '负责人填写错误');
|
||||
}
|
||||
// 创建人
|
||||
$task->userid = User::token2userid();
|
||||
$task->userid = User::userid();
|
||||
// 排序位置
|
||||
if ($top) {
|
||||
$task->sort = intval(self::whereColumnId($task->column_id)->orderBy('sort')->value('sort')) - 1;
|
||||
@ -603,6 +605,7 @@ class ProjectTask extends AbstractModel
|
||||
} else {
|
||||
// 归档任务
|
||||
$this->archived_at = $archived_at;
|
||||
$this->archived_userid = User::userid();
|
||||
$this->addLog("任务归档:" . $this->name);
|
||||
$this->pushMsg('archived');
|
||||
}
|
||||
@ -641,7 +644,7 @@ class ProjectTask extends AbstractModel
|
||||
'project_id' => $this->project_id,
|
||||
'column_id' => $this->column_id,
|
||||
'task_id' => $this->parent_id ?: $this->id,
|
||||
'userid' => $userid ?: User::token2userid(),
|
||||
'userid' => $userid ?: User::userid(),
|
||||
'detail' => $detail,
|
||||
]);
|
||||
$log->save();
|
||||
|
@ -59,7 +59,7 @@ class WebSocketDialog extends AbstractModel
|
||||
throw new ApiException('对话不存在或已被删除');
|
||||
}
|
||||
//
|
||||
$userid = User::token2userid();
|
||||
$userid = User::userid();
|
||||
if ($dialog->type === 'group' && $dialog->group_type === 'task') {
|
||||
// 任务群对话校验是否在项目内
|
||||
$project_id = intval(ProjectTask::whereDialogId($dialog->id)->value('project_id'));
|
||||
|
@ -136,7 +136,7 @@ class WebSocketDialogMsg extends AbstractModel
|
||||
public static function sendMsg($dialog_id, $type, $msg, $sender = 0)
|
||||
{
|
||||
$dialogMsg = self::createInstance([
|
||||
'userid' => $sender ?: User::token2userid(),
|
||||
'userid' => $sender ?: User::userid(),
|
||||
'type' => $type,
|
||||
'msg' => $msg,
|
||||
'read' => 0,
|
||||
|
@ -33,12 +33,14 @@
|
||||
<EDropdownMenu v-if="projectData.owner_userid === userId" slot="dropdown">
|
||||
<EDropdownItem command="setting">{{$L('项目设置')}}</EDropdownItem>
|
||||
<EDropdownItem command="user">{{$L('成员管理')}}</EDropdownItem>
|
||||
<EDropdownItem command="archived" divided>{{$L('归档项目')}}</EDropdownItem>
|
||||
<EDropdownItem command="transfer">{{$L('移交项目')}}</EDropdownItem>
|
||||
<EDropdownItem command="archived_task">{{$L('已归档任务')}}</EDropdownItem>
|
||||
<EDropdownItem command="transfer" divided>{{$L('移交项目')}}</EDropdownItem>
|
||||
<EDropdownItem command="archived">{{$L('归档项目')}}</EDropdownItem>
|
||||
<EDropdownItem command="delete" style="color:#f40">{{$L('删除项目')}}</EDropdownItem>
|
||||
</EDropdownMenu>
|
||||
<EDropdownMenu v-else slot="dropdown">
|
||||
<EDropdownItem command="exit">{{$L('退出项目')}}</EDropdownItem>
|
||||
<EDropdownItem command="archived_task">{{$L('已归档任务')}}</EDropdownItem>
|
||||
<EDropdownItem command="exit" style="color:#f40">{{$L('退出项目')}}</EDropdownItem>
|
||||
</EDropdownMenu>
|
||||
</EDropdown>
|
||||
</li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user