mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-24 21:03:19 +09:00
issue 850 admin favorite bug fix. not use self auto_increment
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9809 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
da50b4b732
commit
499c586a74
4 changed files with 39 additions and 1 deletions
|
|
@ -19,6 +19,9 @@
|
|||
* @brief if update is necessary it returns true
|
||||
**/
|
||||
function checkUpdate() {
|
||||
$oDB = &DB::getInstance();
|
||||
if(!$oDB->isColumnExists("admin_favorite", "type")) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -27,6 +30,26 @@
|
|||
* @return new Object
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
$oDB = &DB::getInstance();
|
||||
if(!$oDB->isColumnExists("admin_favorite", "type"))
|
||||
{
|
||||
$oAdminAdminModel = &getAdminModel('admin');
|
||||
$output = $oAdminAdminModel->getFavoriteList();
|
||||
$favoriteList = $output->get('favoriteList');
|
||||
|
||||
$oDB->dropColumn('admin_favorite', 'admin_favorite_srl');
|
||||
$oDB->addColumn('admin_favorite',"admin_favorite_srl","number",11,0);
|
||||
if(is_array($favoriteList))
|
||||
{
|
||||
$oAdminAdminController = &getAdminController('admin');
|
||||
$oAdminAdminController->_deleteAllFavorite();
|
||||
foreach($favoriteList AS $key=>$value)
|
||||
{
|
||||
$oAdminAdminController->_insertFavorite($value->site_srl, $value->module);
|
||||
}
|
||||
}
|
||||
$oDB->addColumn('admin_favorite',"type","varchar",30, 'module');
|
||||
}
|
||||
return new Object();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue