[更新]修正框架升级后的问题

This commit is contained in:
Anyon 2017-07-04 16:37:46 +08:00
parent dcff0e8d1f
commit e08e427f9d
2 changed files with 3 additions and 3 deletions

View File

@ -105,7 +105,7 @@ class BasicAdmin extends Controller {
}
// 列表数据查询与显示
if (null === $db->getOptions('order')) {
$fields = $db->getTableFields(['table' => $db->getTable()]);
$fields = $db->getTableFields($db->getTable());
in_array('sort', $fields) && $db->order('sort asc');
}
$result = array();

View File

@ -95,7 +95,7 @@ class DataService {
// 删除模式,如果存在 is_deleted 字段使用软删除
if ($field === 'delete') {
if (method_exists($db, 'getTableFields')) {
if (in_array('is_deleted', $db->getTableFields(['table' => $db->getTable()]))) {
if (in_array('is_deleted', $db->getTableFields($db->getTable()))) {
return false !== $db->where($where)->update(['is_deleted' => 1]);
}
}
@ -105,4 +105,4 @@ class DataService {
return false !== $db->where($where)->update([$field => $value]);
}
}
}