* Fix bug #36654.
This commit is contained in:
+1
-1
@@ -16,7 +16,7 @@ if(!class_exists('config')){class config{}}
|
||||
if(!function_exists('getWebRoot')){function getWebRoot(){}}
|
||||
|
||||
/* 基本设置。Basic settings. */
|
||||
$config->version = '18.5'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it.
|
||||
$config->version = '18.6'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it.
|
||||
$config->liteVersion = '1.2'; // 迅捷版版本。 The version of Lite.
|
||||
$config->charset = 'UTF-8'; // ZenTaoPHP的编码。 The encoding of ZenTaoPHP.
|
||||
$config->cookieLife = time() + 2592000; // Cookie的生存时间。The cookie life time.
|
||||
|
||||
@@ -1772,7 +1772,7 @@ class productModel extends model
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function refreshStats()
|
||||
public function refreshStats($refreshAll = false)
|
||||
{
|
||||
$updateTime = zget($this->app->config->global, 'productStatsTime', '');
|
||||
$now = helper::now();
|
||||
@@ -1782,21 +1782,25 @@ class productModel extends model
|
||||
* Else only refresh the latest products in action table.
|
||||
*/
|
||||
$productActions = array();
|
||||
if($updateTime > date('Y-m-d', strtotime('-14 days')))
|
||||
$products = array();
|
||||
if($updateTime < date('Y-m-d', strtotime('-14 days')) or $refreshAll)
|
||||
{
|
||||
$products = $this->dao->select('id')->from(TABLE_PRODUCT)->fetchPairs('id');
|
||||
}
|
||||
else
|
||||
{
|
||||
$productActions = $this->dao->select('distinct product')->from(TABLE_ACTION)
|
||||
->where('date')->ge($updateTime)
|
||||
->andWhere('product')->notin(array(',0,', ',,'))
|
||||
->fetchPairs('product');
|
||||
if(empty($productActions)) return;
|
||||
}
|
||||
|
||||
$products = array();
|
||||
foreach($productActions as $productAction)
|
||||
{
|
||||
foreach(explode(',', trim($productAction, ',')) as $product)
|
||||
foreach($productActions as $productAction)
|
||||
{
|
||||
$products[$product] = $product;
|
||||
foreach(explode(',', trim($productAction, ',')) as $product)
|
||||
{
|
||||
$products[$product] = $product;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1301,7 +1301,7 @@ class programModel extends model
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function refreshStats()
|
||||
public function refreshStats($refreshAll = false)
|
||||
{
|
||||
$updateTime = zget($this->app->config->global, 'projectStatsTime', '');
|
||||
$now = helper::now();
|
||||
@@ -1311,7 +1311,11 @@ class programModel extends model
|
||||
* Else only refresh the latest executions in action table.
|
||||
*/
|
||||
$projects = array();
|
||||
if($updateTime > date('Y-m-d', strtotime('-14 days')))
|
||||
if($updateTime < date('Y-m-d', strtotime('-14 days')) or $refreshAll)
|
||||
{
|
||||
$projects = $this->dao->select('id,project,model')->from(TABLE_PROJECT)->fetchAll('id');
|
||||
}
|
||||
else
|
||||
{
|
||||
$projects = $this->dao->select('distinct t1.project,t2.model')->from(TABLE_ACTION)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id')
|
||||
|
||||
@@ -38,7 +38,8 @@ $config->upgrade->maxVersion['max4_3'] = '18_3';
|
||||
$config->upgrade->maxVersion['max4_4_alpha1'] = '18_4_alpha1';
|
||||
$config->upgrade->maxVersion['max4_4_beta1'] = '18_4_beta1';
|
||||
$config->upgrade->maxVersion['max4_4'] = '18_4';
|
||||
$config->upgrade->maxVersion['max4_5'] = '18_5'; // max insert position.
|
||||
$config->upgrade->maxVersion['max4_5'] = '18_5';
|
||||
$config->upgrade->maxVersion['max4_6'] = '18_6'; // max insert position.
|
||||
|
||||
$config->upgrade->bizVersion = array();
|
||||
$config->upgrade->bizVersion['biz1_0'] = '9_5_1';
|
||||
@@ -115,7 +116,8 @@ $config->upgrade->bizVersion['biz8_3'] = '18_3';
|
||||
$config->upgrade->bizVersion['biz8_4_alpha1'] = '18_4_alpha1';
|
||||
$config->upgrade->bizVersion['biz8_4_beta1'] = '18_4_beta1';
|
||||
$config->upgrade->bizVersion['biz8_4'] = '18_4';
|
||||
$config->upgrade->bizVersion['biz8_5'] = '18_5'; // biz insert position.
|
||||
$config->upgrade->bizVersion['biz8_5'] = '18_5';
|
||||
$config->upgrade->bizVersion['biz8_6'] = '18_6'; // biz insert position.
|
||||
|
||||
$config->upgrade->proVersion = array();
|
||||
$config->upgrade->proVersion['pro1_0'] = '3_1';
|
||||
|
||||
@@ -179,7 +179,8 @@ $lang->upgrade->fromVersions['18_3'] = '18.3';
|
||||
$lang->upgrade->fromVersions['18_4_alpha1'] = '18.4.alpha1';
|
||||
$lang->upgrade->fromVersions['18_4_beta1'] = '18.4.beta1';
|
||||
$lang->upgrade->fromVersions['18_4'] = '18.4';
|
||||
$lang->upgrade->fromVersions['18_5'] = '18.5'; // pms insert position.
|
||||
$lang->upgrade->fromVersions['18_5'] = '18.5';
|
||||
$lang->upgrade->fromVersions['18_6'] = '18.6'; // pms insert position.
|
||||
|
||||
global $config;
|
||||
/* Lite. */
|
||||
@@ -363,7 +364,8 @@ $lang->upgrade->fromVersions['biz8_3'] = 'Biz8.3';
|
||||
$lang->upgrade->fromVersions['biz8_4_alpha1'] = 'Biz8.4.alpha1';
|
||||
$lang->upgrade->fromVersions['biz8_4_beta1'] = 'Biz8.4.beta1';
|
||||
$lang->upgrade->fromVersions['biz8_4'] = 'Biz8.4';
|
||||
$lang->upgrade->fromVersions['biz8_5'] = 'Biz8.5'; // biz insert position.
|
||||
$lang->upgrade->fromVersions['biz8_5'] = 'Biz8.5';
|
||||
$lang->upgrade->fromVersions['biz8_6'] = 'Biz8.6'; // biz insert position.
|
||||
|
||||
/* Max. */
|
||||
$lang->upgrade->fromVersions['max2_0_beta4'] = 'Max2.0.beta4';
|
||||
@@ -404,4 +406,6 @@ $lang->upgrade->fromVersions['max4_2'] = 'Max4.2';
|
||||
$lang->upgrade->fromVersions['max4_3'] = 'Max4.3';
|
||||
$lang->upgrade->fromVersions['max4_4_alpha1'] = 'Max4.4.alpha1';
|
||||
$lang->upgrade->fromVersions['max4_4_beta1'] = 'Max4.4.beta1';
|
||||
$lang->upgrade->fromVersions['max4_4'] = 'Max4.4';
|
||||
$lang->upgrade->fromVersions['max4_5'] = 'Max4.5'; // max insert position.
|
||||
$lang->upgrade->fromVersions['max4_4'] = 'Max4.4'; // max insert position.
|
||||
|
||||
@@ -656,6 +656,10 @@ class upgradeModel extends model
|
||||
$this->fixMissedFlowField();
|
||||
}
|
||||
break;
|
||||
case '18_5':
|
||||
$this->loadModel('product')->refreshStats(true);
|
||||
$this->loadModel('program')->refreshStats(true);
|
||||
break;
|
||||
}
|
||||
|
||||
$this->deletePatch();
|
||||
|
||||
Reference in New Issue
Block a user