diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-02-19 18:27:57 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-02-19 18:27:57 -0500 |
commit | a43f71dda953ab1ca130af875b221569e4767f05 (patch) | |
tree | 33d6f7e650110bbdc5e7bf415b3f5da7735e74d6 /app/Model/ProjectModel.php | |
parent | b5c56d4239c1f4e5c1b7894803c899b595797a26 (diff) |
Redesign project list view
Diffstat (limited to 'app/Model/ProjectModel.php')
-rw-r--r-- | app/Model/ProjectModel.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/Model/ProjectModel.php b/app/Model/ProjectModel.php index b88a8c8b..aa7c002d 100644 --- a/app/Model/ProjectModel.php +++ b/app/Model/ProjectModel.php @@ -318,6 +318,26 @@ class ProjectModel extends Base } /** + * Get query for list of project without column statistics + * + * @access public + * @param array $projectIds + * @return \PicoDb\Table + */ + public function getQueryByProjectIds(array $projectIds) + { + if (empty($projectIds)) { + return $this->db->table(ProjectModel::TABLE)->eq(ProjectModel::TABLE.'.id', 0); + } + + return $this->db + ->table(ProjectModel::TABLE) + ->columns(self::TABLE.'.*', UserModel::TABLE.'.username AS owner_username', UserModel::TABLE.'.name AS owner_name') + ->join(UserModel::TABLE, 'id', 'owner_id') + ->in(self::TABLE.'.id', $projectIds); + } + + /** * Create a project * * @access public |