* fix the error of sn.
This commit is contained in:
@@ -26,6 +26,7 @@ class misc extends control
|
||||
/* 通过隐藏的iframe定时刷新此页面,保证session不过期。*/
|
||||
public function ping()
|
||||
{
|
||||
if(mt_rand(0, 10) == 5) $this->loadModel('setting')->setSN();
|
||||
die("<html><head><meta http-equiv='refresh' content='300' /></head><body></body></html>");
|
||||
}
|
||||
|
||||
|
||||
@@ -61,13 +61,20 @@ class settingModel extends model
|
||||
$item->key = 'sn';
|
||||
$item->value = $this->computeSN();
|
||||
|
||||
$configID = $this->dao->select('id')->from(TABLE_CONFIG)
|
||||
$config = $this->dao->select('id, value')->from(TABLE_CONFIG)
|
||||
->where('company')->eq(0)
|
||||
->andWhere('owner')->eq('system')
|
||||
->andWhere('section')->eq('global')
|
||||
->andWhere('`key`')->eq('sn')
|
||||
->fetch('id', $autoComapny = false);
|
||||
if(!$configID) $this->dao->insert(TABLE_CONFIG)->data($item)->exec($autoCompany = false);
|
||||
->fetch('', $autoComapny = false);
|
||||
if(!$config)
|
||||
{
|
||||
$this->dao->insert(TABLE_CONFIG)->data($item)->exec($autoCompany = false);
|
||||
}
|
||||
elseif($config->value == '281602d8ff5ee7533eeafd26eda4e776' or $config->value == '9bed3108092c94a0db2b934a46268b4a')
|
||||
{
|
||||
$this->dao->update(TABLE_CONFIG)->data($item)->where('id')->eq($config->id)->exec($autoCompany = false);
|
||||
}
|
||||
}
|
||||
|
||||
/* 更新PMS的版本设置。*/
|
||||
|
||||
Reference in New Issue
Block a user