<?php 
namespace Common\Model;
use Think\Model;
class SeoModel extends Model
{
	protected $_validate = array(
		array('name','require', '名称必须填写！',1),
		array('alias','require','别名必须填写！',1),
	);
	//获取列表
	public function get_list($map='',$page=false,$sort='',$num='')
	{
		$limit=$num?$num:10;
		$sort=$sort?$sort:' id asc';
		if ($page)
		{
			$count      = $this->where($map)->count();
			$Page		= pager($count,$limit);
			$limit      = $Page->firstRow.','.$Page->listRows;
			$page_str   = $Page->fshow();
		}
		$result = $this->where($map)->order($sort)->limit($limit)->select();
		foreach ($result as $key => $v){
				//$v['addtime_str']=daterange($v['addtime'],'',"#000");
				$list[]=$v;
		}
		$return['list']=$list;
		if ($page){
		$return['count']=$count;
		}else{
		$return['count']=count($list);
		}
		$return['page']=$page_str;
		//print_r($return);
		return $return;
	}
	 
	
	 
}
?>