<?php
/**
* Class TypeModel 这是一个操作分类表的数据模型
*/
class TypeModel extends Model{
/**
* 添加分类
*/
public function addType($data){
return $this->add($data);
}
/**
* 所有分类
*/
public function selectType($where=array(),$order='',$per=''){
$where['status'] = array('neq','9');
import('ORG.Util.Page');
$count = $this->where($where)->count();
$page = new Page($count,$per);
$type['list'] = $this->where($where)->order($order)->limit($page->firstRow,$per)->select();
$type['page'] = $page->show();
return $type;
}
/**
* 分类信息
*/
public function findType($where=array()){
$where['status'] = array('neq','9');
return $this->where($where)->find();
}
/**
* 修改分类
*/
public function saveType($where=array(),$data){
return $this->where($where)->save($data);
}
} 最佳答案