File: /www/wwwroot/oa.sanjiangapp.com/tmp/model/install.php
<?php
global $app;
helper::cd($app->getBasePath());
helper::import('/www/wwwroot/oa.sanjiangapp.com/app/sys/install/model.php');
helper::cd();
class extinstallModel extends installModel
{
public function createTable($version)
{
$result = parent::createTable($version);
if($result) $this->setXuanxuan();
return $result;
}
/**
* Set version and key for xuanxuan.
*
* @access public
* @return bool
*/
public function setXuanxuan()
{
$sql = "REPLACE INTO `{$this->config->db->name}`.`{$this->config->db->prefix}sys_config` (`owner`, `app`, `module`, `section`, `key`, `value`) VALUES ('system', 'sys', 'xuanxuan', 'global', 'version', '{$this->config->xuanxuan->version}');";
$sql .= "REPLACE INTO `{$this->config->db->name}`.`{$this->config->db->prefix}sys_config` (`owner`, `app`, `module`, `section`, `key`, `value`) VALUES ('system', 'sys', 'common', 'xuanxuan', 'key', '" . md5(md5(time()) . rand()) . "');";
try
{
$this->dbh->query($sql);
}
catch(PDOException $e)
{
return false;
}
return true;
}
//**//
}