public function ajGetGoods() { if (IS_AJAX) { $page = I('get.p', '', 'intval'); $where['state'] = 1; $sort_id = I('get.id', '', 'intval'); if ($sort_id > 0) { $where['sort_id'] = $sort_id; } $once = I('get.once', '', 'intval'); $once = $once > 0 && $once <= 40 ? $once : 0; $count = M('goods')->where($where)->count(); $goods = GoodsModel::I()->_getGoodsList($this->iniPage($count), $where); if ($goods) { $this->assign('goods', $goods); $this->assign('page', $page + 1); } $this->d(); } }