更新项目管理
This commit is contained in:
parent
ace142a41f
commit
56d6e17629
|
@ -25,6 +25,7 @@ class ProjectIndex extends ApiController
|
|||
|
||||
public function index()
|
||||
{
|
||||
$this->checkAuth();
|
||||
$param = get_params();
|
||||
$where = array();
|
||||
if (!empty($param['director_uid'])) {
|
||||
|
@ -253,6 +254,7 @@ class ProjectIndex extends ApiController
|
|||
public function view()
|
||||
{
|
||||
$this->checkAuth();
|
||||
$this->uid = JWT_UID;
|
||||
$param = get_params();
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
$detail = (new ProjectList())->detail($id);
|
||||
|
@ -268,22 +270,6 @@ class ProjectIndex extends ApiController
|
|||
$detail['tasks_finish'] = Db::name('ProjectTask')->where([['project_id', '=', $detail['id']],['flow_status', '>', 2], ['delete_time', '=', 0]])->count();
|
||||
$detail['tasks_unfinish'] = $detail['tasks'] - $detail['tasks_finish'];
|
||||
|
||||
$task_map = [];
|
||||
$task_map[] = ['project_id', '=', $detail['id']];
|
||||
$task_map[] = ['delete_time', '=', 0];
|
||||
//判断是否是创建者或者负责人
|
||||
$role = 0;
|
||||
if ($detail['director_uid'] == $this->uid) {
|
||||
$role = 1; //负责人
|
||||
}
|
||||
if ($detail['admin_id'] == $this->uid) {
|
||||
$role = 2; //创建人
|
||||
}
|
||||
$auth = isAuth($this->uid,'project_admin');
|
||||
if ($auth == 1) {
|
||||
$role = 3; //项目管理员
|
||||
}
|
||||
|
||||
//相关附件
|
||||
$file_array = Db::name('ProjectFile')
|
||||
->field('mf.id,mf.topic_id,mf.admin_id,f.name,f.filesize,f.filepath,f.fileext,f.create_time,f.admin_id,a.name as admin_name')
|
||||
|
|
Loading…
Reference in New Issue