This commit is contained in:
2020-02-17 22:34:34 +08:00
parent 58d999ed73
commit 259d232d89
109 changed files with 10344 additions and 89 deletions

43
app/model/Category.php Normal file
View File

@@ -0,0 +1,43 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace app\model;
/**
* 设置模型
*/
class Category {
protected $name = "Category";
protected $auto = array('update_time', 'status' => 1);
protected $type = array(
'icon' => 'integer',
);
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();
}
}