36 lines
804 B
PHP
36 lines
804 B
PHP
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | 小说系统 [ WE CAN DO IT JUST THINK IT ]
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\common\model;
|
|
|
|
/**
|
|
* 设置模型
|
|
*/
|
|
class Wxcategory extends Base{
|
|
|
|
protected $name = "WechatMenu";
|
|
protected $auto = array('update_time','status'=>1);
|
|
|
|
|
|
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();
|
|
}
|
|
} |