1、修复几处bug;

2、完善内容管理中的细节功能
This commit is contained in:
2020-04-03 17:14:49 +08:00
parent 743d429bb8
commit 2f4386f196
12 changed files with 72 additions and 52 deletions

View File

@@ -21,6 +21,10 @@ class Category extends \think\Model{
'icon' => 'integer',
);
protected static function onAfterUpdate($model){
$data = $model->toArray();
}
public static function getCategoryTree($map = []){
$list = self::where($map)->select();
@@ -31,22 +35,6 @@ class Category extends \think\Model{
return $list;
}
public function change() {
$data = input('post.');
if ($data['id']) {
$result = $this->save($data, array('id' => $data['id']));
} else {
unset($data['id']);
$result = $this->save($data);
}
if (false !== $result) {
return true;
} else {
$this->error = "失败!";
return false;
}
}
public function info($id, $field = true) {
return $this->db()->where(array('id' => $id))->field($field)->find();
}