no message

This commit is contained in:
kuaifan
2021-06-15 16:46:56 +08:00
parent eaf6bcb896
commit e2ae2536b3
7 changed files with 157 additions and 75 deletions

View File

@@ -260,6 +260,7 @@ class Project extends AbstractModel
$column->deleteColumn();
}
if ($this->delete()) {
$this->addLog("删除项目");
return Base::retSuccess('删除成功', $this->toArray());
} else {
return Base::retError('删除失败', $this->toArray());
@@ -268,6 +269,25 @@ class Project extends AbstractModel
return Base::isSuccess($result);
}
/**
* 添加项目日志
* @param string $detail
* @param int $userid
* @return ProjectLog
*/
public function addLog($detail, $userid = 0)
{
$log = ProjectLog::createInstance([
'project_id' => $this->id,
'column_id' => 0,
'task_id' => 0,
'userid' => $userid ?: User::token2userid(),
'detail' => $detail,
]);
$log->save();
return $log;
}
/**
* 根据用户获取项目信息(用于判断会员是否存在项目内)
* @param int $project_id