* Adjust type for statistic block of project.

This commit is contained in:
daitingting
2018-05-25 13:45:37 +08:00
parent e851690722
commit 52b93dc694
4 changed files with 28 additions and 3 deletions
+1 -1
View File
@@ -88,7 +88,7 @@ $lang->block->default['project']['1']['block'] = 'statistic';
$lang->block->default['project']['1']['grid'] = 8;
$lang->block->default['project']['1']['params']['orderBy'] = 'id_desc';
$lang->block->default['project']['1']['params']['type'] = 'noclosed';
$lang->block->default['project']['1']['params']['type'] = 'undone';
$lang->block->default['project']['1']['params']['num'] = 5;
$lang->block->default['project']['2']['title'] = $lang->projectCommon . 'overview';
+1 -1
View File
@@ -88,7 +88,7 @@ $lang->block->default['project']['1']['block'] = 'statistic';
$lang->block->default['project']['1']['grid'] = 8;
$lang->block->default['project']['1']['params']['orderBy'] = 'id_desc';
$lang->block->default['project']['1']['params']['type'] = 'noclosed';
$lang->block->default['project']['1']['params']['type'] = 'undone';
$lang->block->default['project']['1']['params']['num'] = 5;
$lang->block->default['project']['2']['title'] = $lang->projectCommon . '总览';
+1 -1
View File
@@ -88,7 +88,7 @@ $lang->block->default['project']['1']['block'] = 'statistic';
$lang->block->default['project']['1']['grid'] = 8;
$lang->block->default['project']['1']['params']['orderBy'] = 'id_desc';
$lang->block->default['project']['1']['params']['type'] = 'noclosed';
$lang->block->default['project']['1']['params']['type'] = 'undone';
$lang->block->default['project']['1']['params']['num'] = 5;
$lang->block->default['project']['2']['title'] = $lang->projectCommon . '總覽';
+25
View File
@@ -219,6 +219,9 @@ class upgradeModel extends model
case '9_8_3':
$this->execSQL($this->getUpgradeFile('9.8.3'));
$this->adjustPriv10_0_alpha();
case '10_0_alpha':
$this->execSQL($this->getUpgradeFile('10.0.alpha'));
$this->fixProjectStatisticBlock();
}
$this->deletePatch();
@@ -2302,4 +2305,26 @@ class upgradeModel extends model
}
return true;
}
/**
* Fix project statistic block.
*
* @access public
* @return void
*/
public function fixProjectStatisticBlock()
{
$block = $this->dao->select('*')->from(TABLE_BLOCK)->where('module')->eq('my')->andWhere('source')->eq('project')->andWhere('block')->eq('statistic')->fetch();
if($block)
{
$blockParams = json_decode($block->params);
if($blockParams->type == 'noclosed')
{
$blockParams->type = 'undone';
$this->dao->update(TABLE_BLOCK)->set('params')->eq(helper::jsonEncode($blockParams))->where('id')->eq($block->id)->exec();
return !dao::isError();
}
}
return true;
}
}