diff --git a/application/admin/view/menu.index.html b/application/admin/view/menu.index.html
index 6229bf9a6..619dda516 100644
--- a/application/admin/view/menu.index.html
+++ b/application/admin/view/menu.index.html
@@ -10,7 +10,7 @@
-
+
|
-
+
|
@@ -43,7 +43,7 @@
|
{if auth("$classuri/edit")}
|
- 编辑
+ 编辑
{/if}
{if $vo.status eq 1 and auth("$classuri/forbid")}
|
diff --git a/extend/controller/BasicAdmin.php b/extend/controller/BasicAdmin.php
index 49a487f3c..875fa9354 100644
--- a/extend/controller/BasicAdmin.php
+++ b/extend/controller/BasicAdmin.php
@@ -61,7 +61,6 @@ class BasicAdmin extends Controller {
$class_uri = strtolower($this->request->module() . '/' . $this->request->controller());
$this->assign('classuri', $class_uri);
}
-
}
/**
@@ -85,8 +84,11 @@ class BasicAdmin extends Controller {
* @return array|string
*/
protected function _list($db = null, $is_page = true, $is_display = true, $total = false) {
- is_null($db) && $db = Db::name($this->table);
- is_string($db) && $db = Db::name($db);
+ if (is_null($db)) {
+ $db = Db::name($this->table);
+ } elseif (is_string($db)) {
+ $db = Db::name($db);
+ }
# 列表排序默认处理
if ($this->request->isPost() && $this->request->post('action') === 'resort') {
$data = $this->request->post();
@@ -127,10 +129,14 @@ class BasicAdmin extends Controller {
* @return array|string
*/
protected function _form($db = null, $tpl = null, $pk = null, $where = [], $data = []) {
- is_null($db) && $db = db($this->table);
- is_string($db) && $db = db($db);
- !$db->getTable() && $db->setTable($this->table);
- is_null($pk) && $pk = $db->getPk();
+ if (is_null($db)) {
+ $db = Db::name($this->table);
+ } elseif (is_string($db)) {
+ $db = Db::name($db);
+ }
+ if (is_null($pk)) {
+ $pk = $db->getPk();
+ }
$pk_value = input($pk, isset($where[$pk]) ? $where[$pk] : (isset($data[$pk]) ? $data[$pk] : ''));
$vo = $data;
if ($this->request->isPost()) { // Save Options
@@ -145,7 +151,7 @@ class BasicAdmin extends Controller {
if ($pk_value !== '') { // Edit Options
!empty($pk_value) && $db->where($pk, $pk_value);
!empty($where) && $db->where($where);
- $vo = array_merge($data, (array)$db->find());
+ $vo = array_merge($data, (array) $db->find());
}
$this->_callback('_form_filter', $vo);
$this->assign('vo', $vo);
@@ -153,7 +159,6 @@ class BasicAdmin extends Controller {
return is_null($tpl) ? $vo : $this->display($tpl);
}
-
/**
* 当前对象回调成员方法
* @param string $method
@@ -168,4 +173,5 @@ class BasicAdmin extends Controller {
}
return true;
}
-}
\ No newline at end of file
+
+}
diff --git a/extend/library/Data.php b/extend/library/Data.php
index fd1a8beec..441dea0a4 100644
--- a/extend/library/Data.php
+++ b/extend/library/Data.php
@@ -69,16 +69,15 @@ class Data {
* @return bool
*/
static public function save($db, $data, $upkey = 'id', $where = []) {
- $db = is_string($db) ? db($db) : $db;
- $fields = $db->getFieldsType(['table' => $db->getTable()]);
+ if (is_string($db)) {
+ $db = Db::name($db);
+ }
+ $fields = $db->getTableFields(['table' => $db->getTable()]);
$_data = [];
foreach ($data as $k => $v) {
- if (array_key_exists($k, $fields)) {
- $_data[$k] = $v;
- }
+ in_array($k, $fields) && ($_data[$k] = $v);
}
- $db = self::_apply_save_where($db, $data, $upkey, $where);
- if ($db->getOptions() && $db->count() > 0) {
+ if (self::_apply_save_where($db, $data, $upkey, $where)->count() > 0) {
return self::_apply_save_where($db, $data, $upkey, $where)->update($_data) !== FALSE;
}
return self::_apply_save_where($db, $data, $upkey, $where)->insert($_data) !== FALSE;
@@ -110,13 +109,12 @@ class Data {
* @return bool|null
*/
static public function update(&$db, $where = []) {
- if (!request()->isPost()) {
- return null;
+ if (is_string($db)) {
+ $db = Db::name($db);
}
- $db = is_string($db) ? db($db) : $db;
- $ids = explode(',', input("post.id", '', 'trim'));
- $field = input('post.field', '', 'trim');
- $value = input('post.value', '', 'trim');
+ $ids = explode(',', input("post.id", ''));
+ $field = input('post.field', '');
+ $value = input('post.value', '');
$pk = $db->getPk(['table' => $db->getTable()]);
$db->where(empty($pk) ? 'id' : $pk, 'in', $ids);
!empty($where) && $db->where($where);
diff --git a/public/static/theme/default/css/console.css b/public/static/theme/default/css/console.css
index 90874e54e..d13378d80 100644
--- a/public/static/theme/default/css/console.css
+++ b/public/static/theme/default/css/console.css
@@ -118,6 +118,7 @@ input::-ms-clear{display:none}
::-moz-selection{background-color:#ec494e;color:#FFF}
.layui-box legend{width:auto!important;border-bottom:none!important}
+.layui-btn {border-radius:0!important}
/** checkbox 优化 */
input[type=checkbox],input[type=radio]{-webkit-appearance:none;appearance:none;width:18px;height:18px;margin:0;cursor:pointer;vertical-align:bottom;background:#fff;border:1px solid #dcdcdc;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative}
@@ -164,7 +165,7 @@ td .text-explode:first-child{opacity:0;display:none}
/** 列表排序样式 */
.list-table-sort-td{width:60px !important;text-align:center}
-.list-table-sort-td input{width:50px;text-align:center;font-size:12px;line-height:14px;padding:2px}
+.list-table-sort-td input{width:50px;text-align:center;font-size:12px;line-height:14px;padding:2px;border:1px solid #e6e6e6}
/*.list-table-sort-td button{width:50px;text-align:center;font-size:12px;color:#333}*/
/** 列表选择框 */
|