mirror of
https://gitee.com/wonderful-code/buildadmin
synced 2024-11-21 22:55:36 +00:00
refactor:优化细节
This commit is contained in:
parent
caefde41a3
commit
085ac9c626
@ -72,14 +72,12 @@ class Ajax extends Backend
|
|||||||
if (!$table) {
|
if (!$table) {
|
||||||
$this->error(__('Parameter error'));
|
$this->error(__('Parameter error'));
|
||||||
}
|
}
|
||||||
$tablePk = Db::query("SHOW TABLE STATUS LIKE '$table'", [], true);
|
|
||||||
if (!$tablePk) {
|
$table = TableManager::tableName($table);
|
||||||
$table = config('database.connections.mysql.prefix') . $table;
|
if (!TableManager::phinxAdapter(false)->hasTable($table)) {
|
||||||
$tablePk = Db::query("SHOW TABLE STATUS LIKE '$table'", [], true);
|
|
||||||
if (!$tablePk) {
|
|
||||||
$this->error(__('Data table does not exist'));
|
$this->error(__('Data table does not exist'));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
$tablePk = Db::table($table)->getPk();
|
$tablePk = Db::table($table)->getPk();
|
||||||
$this->success('', ['pk' => $tablePk]);
|
$this->success('', ['pk' => $tablePk]);
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,7 @@ class SensitiveData extends Backend
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加重写
|
* 添加重写
|
||||||
|
* @throws Throwable
|
||||||
*/
|
*/
|
||||||
public function add(): void
|
public function add(): void
|
||||||
{
|
{
|
||||||
|
@ -428,6 +428,7 @@ class Helper
|
|||||||
* @param array $fields 字段数据
|
* @param array $fields 字段数据
|
||||||
* @param array $designChange 前端字段改变数据
|
* @param array $designChange 前端字段改变数据
|
||||||
* @return void
|
* @return void
|
||||||
|
* @throws Throwable
|
||||||
*/
|
*/
|
||||||
public static function updateFieldOrder(string $tableName, array $fields, array $designChange): void
|
public static function updateFieldOrder(string $tableName, array $fields, array $designChange): void
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user