* Optimize dynamic page opening speed.
This commit is contained in:
@@ -740,7 +740,7 @@ class actionModel extends model
|
||||
$actionCondition = $this->getActionCondition();
|
||||
if(!$actionCondition && !$this->app->user->admin && isset($this->app->user->rights['acls']['actions'])) return array();
|
||||
|
||||
$condition = "`objectType` IN ('doc', 'doclib') OR ({$condition})";
|
||||
$condition = "`objectType` IN ('doc', 'doclib')" . $condition = '1=1'? '' : "OR ({$condition})";
|
||||
|
||||
$programCondition = empty($this->app->user->view->programs) ? '0' : $this->app->user->view->programs;
|
||||
$condition .= " OR (`objectID` in ($programCondition) AND `objectType` = 'program')";
|
||||
|
||||
@@ -611,16 +611,17 @@ class actionTao extends actionModel
|
||||
public function processEffortCondition(string &$condition, string $period, string $begin, string $end, string $beginDate): void
|
||||
{
|
||||
$efforts = $this->dao->select('id')->from(TABLE_EFFORT)
|
||||
->where($condition)
|
||||
->where('NOT ' . $condition)
|
||||
->beginIF($period != 'all')
|
||||
->beginIF($begin)->andWhere('date')->gt($begin)->fi()
|
||||
->beginIF($end)->andWhere('date')->lt($end)->fi()
|
||||
->fi()
|
||||
->beginIF($beginDate)->andWhere('date')->ge($beginDate)->fi()
|
||||
->fetchPairs();
|
||||
|
||||
$efforts = !empty($efforts) ? implode(',', $efforts) : 0;
|
||||
|
||||
$condition .= " OR (`objectID` IN ({$efforts}) AND `objectType` = 'effort')";
|
||||
$condition .= " OR (`objectID` NOT IN ({$efforts}) AND `objectType` = 'effort')";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user