* Fix get dynamic error.

This commit is contained in:
holan20180123
2021-03-10 11:16:49 +08:00
parent c09dfd6fd2
commit 940d9cbed3
+5 -5
View File
@@ -640,7 +640,7 @@ class actionModel extends model
* @param string $orderBy
* @param object $pager
* @param string|int $productID all|int(like 123)|notzero all => include zero, notzero, greater than 0
* @param string|int $executionID same as productID
* @param string|int $projectID same as productID
* @param string $date
* @param string $direction
* @access public
@@ -657,14 +657,14 @@ class actionModel extends model
if($productID == 'all') $products = $this->app->user->view->products;
if($projectID == 'all') $projects = $this->app->user->view->projects;
if($productID == 'all' or $executionID == 'all')
if($productID == 'all' or $projectID == 'all')
{
$projectCondition = $projectID == 'all' ? "project " . helper::dbIN($projects) : '';
$projectCondition = $projectID == 'all' ? "execution " . helper::dbIN($projects) : '';
$productCondition = $productID == 'all' ? "INSTR('," . $products . ",', product) > 0" : '';
if(is_numeric($productID)) $productCondition = "product like'%,$productID,%' or product='$productID'";
if(is_numeric($projectID)) $projectCondition = "project='$projectID'";
if(is_numeric($projectID)) $projectCondition = "execution='$projectID'";
$condition = "(product =',0,' AND project = '0')";
$condition = "(product =',0,' AND execution = '0')";
if($projectCondition) $condition .= ' OR ' . $projectCondition;
if($productCondition) $condition .= ' OR ' . $productCondition;
if($this->app->user->admin) $condition = 1;