<?php
class GoodsModel extends Model{
	
	public static function I(){
        return new GoodsModel();
	}
    public function delGoods($goods_id){
        $this->where("goods_id='{$goods_id}'")->delete();
    }

    public function getGoodsById($goods_id=0){
        return $this->where("goods_id='{$goods_id}'")->find();
    }

    public function goodsCount($where=1){
        return $this->where($where)->count();            
    }
    
    public function _getGoodsList($Page,$where){
        $goods = M('goods')->where($where)->order('`order` DESC,goods_id DESC')->limit($Page->firstRow.','.$Page->listRows)->select();
        return $goods;
    }
}