Merge branch release/21.7.7 of zentao/zentaopms (#12236)
This commit is contained in:
@@ -5,6 +5,7 @@ ALTER TABLE `zt_risk` CHANGE `pri` `pri` tinyint unsigned NOT NULL DEFAULT 3;
|
||||
ALTER TABLE `zt_opportunity` CHANGE `pri` `pri` tinyint unsigned NOT NULL DEFAULT 3;
|
||||
ALTER TABLE `zt_design` CHANGE `project` `project` int unsigned NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `zt_design` CHANGE `product` `product` int unsigned NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `zt_acl` CHANGE `id` `id` int unsigned NOT NULL;
|
||||
|
||||
ALTER TABLE `zt_doc` ADD `reportModule` varchar(20) NOT NULL DEFAULT '0' AFTER `module`;
|
||||
UPDATE `zt_doc` SET `reportModule` = `module` WHERE `templateType` = 'projectReport';
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ USE `__TABLE__`;
|
||||
|
||||
-- DROP TABLE IF EXISTS `zt_acl`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_acl` (
|
||||
`id` mediumint(9) NOT NULL AUTO_INCREMENT,
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`account` char(30) NOT NULL DEFAULT '',
|
||||
`objectType` char(30) NOT NULL DEFAULT '',
|
||||
`objectID` mediumint(9) NOT NULL DEFAULT '0',
|
||||
|
||||
@@ -696,19 +696,14 @@ class transferModel extends model
|
||||
$queryCondition = str_replace("`type` = '$module'", '1 = 1', $queryCondition);
|
||||
}
|
||||
|
||||
$selectedFields = 't1.*';
|
||||
if($orderBy && strpos($orderBy, 'priOrder') !== false) $selectedFields .= ",IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder";
|
||||
if($orderBy && strpos($orderBy, 'severityOrder') !== false) $selectedFields .= ",IF(t1.`severity` = 0, {$this->config->maxPriValue}, t1.`severity`) as severityOrder";
|
||||
$selectedFields = '*';
|
||||
if($orderBy && strpos($orderBy, 'priOrder') !== false) $selectedFields .= ",IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) AS priOrder";
|
||||
if($orderBy && strpos($orderBy, 'severityOrder') !== false) $selectedFields .= ",IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) AS severityOrder";
|
||||
|
||||
$table = zget($this->config->objectTables, $module); //获取对应的表
|
||||
$sql = $this->dao->select($selectedFields)->from($table)->alias('t1');
|
||||
if($module == 'task' && strpos($queryCondition, '`assignedTo`') !== false)
|
||||
{
|
||||
preg_match("/`assignedTo`\s+(([^']*) ('([^']*)'))/", $queryCondition, $matches);
|
||||
$sql = $sql->leftJoin(TABLE_TASKTEAM)->alias('t2')->on("t2.task = t1.id and t2.account $matches[1]");
|
||||
}
|
||||
$moduleDatas = $sql->where($queryCondition)
|
||||
->beginIF($this->post->exportType == 'selected')->andWhere('t1.id')->in($checkedItem)->fi()
|
||||
$moduleDatas = $this->dao->select($selectedFields)->from($table)
|
||||
->where($queryCondition)
|
||||
->beginIF($this->post->exportType == 'selected')->andWhere('id')->in($checkedItem)->fi()
|
||||
->beginIF($orderBy)->orderBy($orderBy)->fi()
|
||||
->fetchAll('id', false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user