* Optimize code.

This commit is contained in:
wangyuting2
2022-05-10 16:41:36 +08:00
parent 248683c67d
commit bcf64c0c54
+19 -13
View File
@@ -83,12 +83,15 @@ class model extends baseModel
if(isset($this->config->bizVersion))
{
static $actions;
if(empty($actions)) $actions = $this->dao->select('*')->from(TABLE_WORKFLOWACTION)
->where('module')->eq($moduleName)
->andWhere('buildin')->eq('1')
->andWhere('status')->eq('enable')
->beginIF(!empty($this->config->vision))->andWhere('vision')->eq($this->config->vision)->fi()
->fetchAll('action');
if(empty($actions))
{
$actions = $this->dao->select('*')->from(TABLE_WORKFLOWACTION)
->where('module')->eq($moduleName)
->andWhere('buildin')->eq('1')
->andWhere('status')->eq('enable')
->beginIF(!empty($this->config->vision))->andWhere('vision')->eq($this->config->vision)->fi()
->fetchAll('action');
}
}
$enabled = true;
@@ -138,13 +141,16 @@ class model extends baseModel
if(strpos($module, '.') !== false) list($appName, $moduleName) = explode('.', $module);
static $actions;
if(empty($actions)) $actions = $this->dao->select('*')->from(TABLE_WORKFLOWACTION)
->where('module')->eq($moduleName)
->andWhere('buildin')->eq('0')
->andWhere('status')->eq('enable')
->beginIF(!empty($this->config->vision))->andWhere('vision')->eq($this->config->vision)->fi()
->orderBy('order_asc')
->fetchAll();
if(empty($actions))
{
$actions = $this->dao->select('*')->from(TABLE_WORKFLOWACTION)
->where('module')->eq($moduleName)
->andWhere('buildin')->eq('0')
->andWhere('status')->eq('enable')
->beginIF(!empty($this->config->vision))->andWhere('vision')->eq($this->config->vision)->fi()
->orderBy('order_asc')
->fetchAll();
}
$menu = '';
if($show)