* [refac story #74538] Add db index.

This commit is contained in:
wangyidong
2025-06-03 13:05:27 +08:00
parent 41ee72b64a
commit 2fecd243de
5 changed files with 13 additions and 4 deletions
+7 -3
View File
@@ -1,11 +1,15 @@
CREATE TABLE IF NOT EXISTS `zt_actionproduct` (
`action` mediumint(8) unsigned NOT NULL,
`product` mediumint(8) unsigned NOT NULL,
`product` mediumint(8) unsigned NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
CREATE INDEX `action_product` ON `zt_actionproduct`(`action`, `product`);
ALTER TABLE `zt_actionrecent` ADD INDEX `vision_date` (`vision`, `date`);
ALTER TABLE `zt_actionrecent` DROP INDEX `date`;
ALTER TABLE `zt_actionrecent` ADD INDEX `vision_date` (`vision`, `date`);
ALTER TABLE `zt_actionrecent` ADD INDEX `execution` (`execution`);
ALTER TABLE `zt_action` ADD INDEX `vision_date` (`vision`, `date`);
ALTER TABLE `zt_action` DROP INDEX `date`;
ALTER TABLE `zt_action` DROP INDEX `project`;
ALTER TABLE `zt_action` ADD INDEX `vision_date` (`vision`, `date`);
ALTER TABLE `zt_action` ADD INDEX `execution` (`execution`);
ALTER TABLE `zt_action` ADD INDEX `project` (`project`);
+1 -1
View File
@@ -1211,7 +1211,7 @@ class actionModel extends model
$docLibList = $this->dao->select('*')->from(TABLE_DOCLIB)->where('id')->in($docLibIdList)->fetchAll('id');
foreach($docLibList as $docLib)
{
if(!$this->checkPrivLib($docLib)) unset($docLibList[$lib->id]);
if(!$this->checkPrivLib($docLib)) unset($docLibList[$docLib->id]);
}
}
+2
View File
@@ -2571,6 +2571,8 @@ class execution extends control
*/
public function dynamic(int $executionID = 0, string $type = 'today', string $param = '', int $recTotal = 0, string $date = '', string $direction = 'next')
{
if(empty($type)) $type = 'today';
/* Save session. */
$uri = $this->app->getURI(true);
$this->session->set('productList', $uri, 'product');
+1
View File
@@ -497,6 +497,7 @@ class product extends control
*/
public function dynamic(int $productID = 0, string $type = 'today', int $param = 0, int $recTotal = 0, string $date = '', string $direction = 'next')
{
if(empty($type)) $type = 'today';
$this->loadModel('action');
/* Save env data. */
+2
View File
@@ -747,6 +747,8 @@ class project extends control
*/
public function dynamic(int $projectID = 0, string $type = 'today', string $param = '', int $recTotal = 0, int $date = 0, string $direction = 'next')
{
if(empty($type)) $type = 'today';
$this->loadModel('execution');
$this->project->setMenu($projectID);