diff --git a/application/admin/lang/zh-cn.php b/application/admin/lang/zh-cn.php index 7b85612a..fbd6bf5b 100755 --- a/application/admin/lang/zh-cn.php +++ b/application/admin/lang/zh-cn.php @@ -130,6 +130,7 @@ return [ 'Network error' => '网络错误!', 'Invalid parameters' => '未知参数', 'No results were found' => '记录未找到', + 'No rows were inserted' => '未插入任何行', 'No rows were deleted' => '未删除任何行', 'No rows were updated' => '未更新任何行', 'Parameter %s can not be empty' => '参数%s不能为空', diff --git a/application/admin/lang/zh-cn/category.php b/application/admin/lang/zh-cn/category.php index 8f3336dc..e7dae0e4 100644 --- a/application/admin/lang/zh-cn/category.php +++ b/application/admin/lang/zh-cn/category.php @@ -3,7 +3,7 @@ return [ 'Id' => 'ID', 'Pid' => '父ID', - 'Type' => '栏目类型', + 'Type' => '类型', 'All' => '全部', 'Image' => '图片', 'Keywords' => '关键字', @@ -12,6 +12,7 @@ return [ 'Createtime' => '创建时间', 'Updatetime' => '更新时间', 'Weigh' => '权重', + 'Category warmtips' => '温馨提示:栏目类型请前往常规管理->系统配置->字典配置中进行管理', 'Can not change the parent to child' => '父组别不能是它的子组别', 'Status' => '状态' ]; diff --git a/application/admin/library/traits/Backend.php b/application/admin/library/traits/Backend.php index c543c689..1ed9d9f7 100755 --- a/application/admin/library/traits/Backend.php +++ b/application/admin/library/traits/Backend.php @@ -118,7 +118,7 @@ trait Backend if ($this->modelValidate) { $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; - $this->model->validate($validate); + $this->model->validateFailException(true)->validate($validate); } $result = $this->model->allowField(true)->save($params); Db::commit(); @@ -132,10 +132,10 @@ trait Backend Db::rollback(); $this->error($e->getMessage()); } - if ($result) { + if ($result !== false) { $this->success(); } else { - $this->error(); + $this->error(__('No rows were inserted')); } } $this->error(__('Parameter %s can not be empty', '')); @@ -169,7 +169,7 @@ trait Backend if ($this->modelValidate) { $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate; - $row->validate($validate); + $row->validateFailException(true)->validate($validate); } $result = $row->allowField(true)->save($params); Db::commit(); @@ -183,10 +183,10 @@ trait Backend Db::rollback(); $this->error($e->getMessage()); } - if ($result) { + if ($result !== false) { $this->success(); } else { - $this->error(); + $this->error(__('No rows were updated')); } } $this->error(__('Parameter %s can not be empty', '')); diff --git a/application/admin/view/category/add.html b/application/admin/view/category/add.html index a09d8f7a..b0fe795c 100644 --- a/application/admin/view/category/add.html +++ b/application/admin/view/category/add.html @@ -1,5 +1,9 @@