Merge branch 'sprint/224_hufangzhou_doc'
This commit is contained in:
@@ -1182,11 +1182,14 @@ CREATE TABLE `zt_im_chat` (
|
||||
`ownedBy` varchar(30) NOT NULL DEFAULT '',
|
||||
`editedBy` varchar(30) NOT NULL DEFAULT '',
|
||||
`editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`mergedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`lastMessage` int(11) unsigned NOT NULL DEFAULT '0',
|
||||
`lastMessageIndex` int(11) unsigned NOT NULL DEFAULT 0,
|
||||
`dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`pinnedMessages` text NOT NULL,
|
||||
`mergedChats` text NOT NULL DEFAULT '',
|
||||
`adminInvite` enum('0','1') NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `gid` (`gid`),
|
||||
KEY `name` (`name`),
|
||||
|
||||
@@ -536,8 +536,8 @@ class upgradeModel extends model
|
||||
if(!$executedXuanxuan)
|
||||
{
|
||||
$table = $this->config->db->prefix . 'im_chat';
|
||||
$result = $this->checkFieldsExists($table, 'adminInvite');
|
||||
if($result->rowCount() == 0)
|
||||
$exists = $this->checkFieldsExists($table, 'adminInvite');
|
||||
if(!$exists)
|
||||
{
|
||||
$this->dbh->query("ALTER TABLE $table ADD `adminInvite` enum('0','1') NOT NULL DEFAULT '0' AFTER `mergedChats`");
|
||||
}
|
||||
@@ -7081,10 +7081,12 @@ class upgradeModel extends model
|
||||
* @param string $table
|
||||
* @param string $field
|
||||
* @access public
|
||||
* @return object
|
||||
* @return bool
|
||||
*/
|
||||
public function checkFieldsExists($table, $field)
|
||||
{
|
||||
return $this->dbh->query("show columns from `$table` like '$field'");
|
||||
$result = $this->dbh->query("show columns from `$table` like '$field'");
|
||||
|
||||
return $result->rowCount() > 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user