* Finish task #4978,#4979,#4985,#4992,#4998,#5003,#5004,#5005,#5006,

This commit is contained in:
yfl
2018-10-11 10:48:18 +08:00
parent 9263cafb61
commit 2dfb4aeeda
7 changed files with 15 additions and 13 deletions
+2
View File
@@ -93,6 +93,7 @@ class reportModel extends model
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t1.status')->ne('cancel')
->andWhere('t1.deleted')->eq(0)
->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->projects)->fi()
->andWhere('t2.deleted')->eq(0)
->andWhere('t1.parent')->eq(0)
->andWhere('t2.status')->eq('closed')
@@ -131,6 +132,7 @@ class reportModel extends model
$products = $this->dao->select('id, code, name, PO')->from(TABLE_PRODUCT)
->where('deleted')->eq(0)
->beginIF(strpos($conditions, 'closedProduct') === false)->andWhere('status')->ne('closed')->fi()
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->products)->fi()
->fetchAll('id');
$plans = $this->dao->select('*')->from(TABLE_PRODUCTPLAN)->where('deleted')->eq(0)->andWhere('product')->in(array_keys($products))
->beginIF(strpos($conditions, 'overduePlan') === false)->andWhere('end')->gt(date('Y-m-d'))->fi()