mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-15 04:52:50 +00:00
一键安装bug修复
This commit is contained in:
parent
e059b0eebe
commit
01e4017f35
File diff suppressed because one or more lines are too long
@ -134,6 +134,7 @@ switch ($step) {
|
||||
'runtime/cache',
|
||||
'runtime/temp',
|
||||
'runtime/log',
|
||||
'runtime/schema',
|
||||
'application/database.php',
|
||||
'application/config.php',
|
||||
);
|
||||
@ -260,11 +261,21 @@ switch ($step) {
|
||||
|
||||
|
||||
// 清空测试数据
|
||||
if($_POST['demo'] != 'demo')
|
||||
if(!$_POST['demo'])
|
||||
{
|
||||
$result = mysqli_query($conn,"show tables");
|
||||
$tables=mysqli_fetch_all($result,MYSQLI_ASSOC);//参数MYSQL_ASSOC、MYSQLI_NUM、MYSQLI_BOTH规定产生数组类型
|
||||
$bl_table = array('eb_system_config','eb_system_config_tab','eb_system_menus','eb_system_file','eb_express','eb_system_group','eb_system_group_data');
|
||||
$tables=mysqli_fetch_all($result);//参数MYSQL_ASSOC、MYSQLI_NUM、MYSQLI_BOTH规定产生数组类型
|
||||
$bl_table = array('eb_system_admin'
|
||||
,'eb_system_role'
|
||||
,'eb_system_config'
|
||||
,'eb_system_config_tab'
|
||||
,'eb_system_menus'
|
||||
,'eb_system_file'
|
||||
,'eb_express'
|
||||
,'eb_system_group'
|
||||
,'eb_system_group_data'
|
||||
,'eb_wechat_template'
|
||||
,'eb_routine_template');
|
||||
foreach($bl_table as $k => $v)
|
||||
{
|
||||
$bl_table[$k] = str_replace('eb_',$dbPrefix,$v);
|
||||
|
||||
@ -167,7 +167,7 @@ switch ($step) {
|
||||
for ($i = $n; $i < $counts; $i++) {
|
||||
$sql = trim($sqlFormat[$i]);
|
||||
if (strstr($sql, 'CREATE TABLE')) {
|
||||
preg_match('/CREATE TABLE IF NOT EXISTS `eb_([^ ]*)`/is', $sql, $matches);
|
||||
preg_match('/CREATE TABLE `eb_([^ ]*)`/is', $sql, $matches);
|
||||
mysqli_query($conn,"DROP TABLE IF EXISTS `$matches[1]");
|
||||
$sql = str_replace('`eb_','`'.$dbPrefix,$sql);//替换表前缀
|
||||
$ret = mysqli_query($conn,$sql);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user