hasOne(User::class, 'id', 'director_uid')->field(['id', 'nickname', 'avatar']); } // 关闭任务 public function closeTask($id) { return Task::where(['id'=>$id])->save(['status'=>5]); } }