mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进数据表的前缀设置
This commit is contained in:
2
base.php
2
base.php
@@ -90,7 +90,7 @@ function G($start,$end='',$dec=6) {
|
||||
* @return Model
|
||||
*/
|
||||
function M($name='', $tablePrefix='',$connection='') {
|
||||
return think\Loader::table($name,['table_prefix'=>$tablePrefix,'connection'=>$connection]);
|
||||
return think\Loader::table($name,['prefix'=>$tablePrefix,'connection'=>$connection]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -69,6 +69,8 @@ class Model {
|
||||
|
||||
if(isset($config['prefix'])) {
|
||||
$this->tablePrefix = $config['prefix'];
|
||||
}else{
|
||||
$this->tablePrefix = Config::get('database.prefix');
|
||||
}
|
||||
if(isset($config['connection'])) {
|
||||
$this->connection = $config['connection'];
|
||||
|
||||
Reference in New Issue
Block a user