* Adjust the style of the prompt in multi-user task

* Add unique key to team table.
This commit is contained in:
wumo
2018-04-04 13:13:09 +08:00
parent b13eac3b36
commit 58159b3d42
3 changed files with 32 additions and 2 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
ALTER TABLE `zt_team` DROP PRIMARY KEY;
ALTER TABLE `zt_team` ADD PRIMARY KEY (`root`, `type`, `account`);
ALTER TABLE `zt_team` ADD `id` mediumint(8) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT FIRST;
ALTER TABLE `zt_project` CHANGE `team` `team` varchar(90) NOT NULL;
+1 -1
View File
@@ -108,7 +108,7 @@ $lang->task->parent = '父任务';
$lang->task->parentAB = '父';
$lang->task->lblPri = 'P';
$lang->task->lblHour = '(h)';
$lang->task->deniedNotice = '当前任务只有%s才可以%s';
$lang->task->deniedNotice = '当前任务只有%s才可以%s。';
$lang->task->ditto = '同上';
$lang->task->dittoNotice = "该任务与上一任务不属于同一项目!";
+30
View File
@@ -214,6 +214,7 @@ class upgradeModel extends model
$this->resetProductLine();
case '9_8_2':
$this->execSQL($this->getUpgradeFile('9.8.2'));
$this->addUniqueKeyToTeam();
}
$this->deletePatch();
@@ -2244,4 +2245,33 @@ class upgradeModel extends model
$this->dao->update(TABLE_PRODUCT)->set('line')->eq(0)->where('line')->in($deletedLines)->exec();
return !dao::isError();
}
/**
* Add unique key to team table.
*
* @access public
* @return bool
*/
public function addUniqueKeyToTeam()
{
$members = $this->dao->select('root, type, account')->from(TABLE_TEAM)->groupBy('root, type, account')->having('count(*)')->gt(1)->fetchAll();
foreach($members as $member)
{
$maxID = $this->dao->select('MAX(id) id')
->from(TABLE_TEAM)
->where('root')->eq($member->root)
->andWhere('`type`')->eq($member->type)
->andWhere('account')->eq($member->account)
->fetch('id');
$this->dao->delete()->from(TABLE_TEAM)
->where('root')->eq($member->root)
->andWhere('`type`')->eq($member->type)
->andWhere('account')->eq($member->account)
->andWhere('id')->ne($maxID)
->exec();
}
$this->dao->exec("ALTER TABLE `zt_team` ADD UNIQUE `team` (`root`, `type`, `account`)");
return !dao::isError();
}
}