|
|
@@ -219,6 +219,8 @@ class InitController extends Controller
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ self::migrationDel();
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -301,7 +303,7 @@ class InitController extends Controller
|
|
|
|
|
|
public static function migration($main, $shop)
|
|
|
{
|
|
|
- //shop数据迁移到main
|
|
|
+ //shop数据迁移到main,保存之后请在migrationDel()增加对应字段!!!!!!
|
|
|
$main->balance = $shop->balance ?? 0;
|
|
|
$main->freezeBalance = $shop->freezeBalance ?? 0;
|
|
|
$main->txBalance = $shop->txBalance ?? 0;
|
|
|
@@ -326,7 +328,11 @@ class InitController extends Controller
|
|
|
$main->cashAccount = $shop->cashAccount ?? '';
|
|
|
$main->cashBank = $shop->cashBank ?? '';
|
|
|
$main->save();
|
|
|
+ }
|
|
|
|
|
|
+ //迁移完成之后删除xhShop对应字段
|
|
|
+ public static function migrationDel()
|
|
|
+ {
|
|
|
$sql = "ALTER TABLE `xhShop` DROP COLUMN `balance`;";
|
|
|
Yii::$app->db->createCommand($sql)->execute();
|
|
|
$sql = "ALTER TABLE `xhShop` DROP COLUMN `freezeBalance`;";
|