init
This commit is contained in:
13
app/helper.php
Executable file
13
app/helper.php
Executable file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
use think\Db;
|
||||
|
||||
// 增加一个新的table助手函数
|
||||
function table($table, $config = []) {
|
||||
return \think\Db::connect($config)->setTable($table);
|
||||
}
|
||||
|
||||
// 替换已有的db助手函数
|
||||
function db($name, $config = []) {
|
||||
return \think\Db::connect($config)->name($name);
|
||||
}
|
||||
Reference in New Issue
Block a user