1 回答

慕勒0069038
TA貢獻(xiàn)143條經(jīng)驗(yàn) 獲得超39個(gè)贊
pageindex 代表頁碼 pagesize代表一頁顯示多少個(gè)
?$post =json_decode($this->input->raw_input_stream);
$pageindex =$post->pageindex;
$pagesize= $post->pagesize;
if(isset($post->狀態(tài)))
{
????$this->db->where("狀態(tài)屬性",$post->狀態(tài));
}
$this->db->from("表名稱");
$this->db->limit(??($pageindex-1)*$pagesize ,$pagesize?); //這里是分頁關(guān)鍵
$result=$this->db->get()->result();
?echo json_encode(array(
??????????? "result" => 1,
??????????? "msg"=>"查詢成功!",
??????????? "data"=>$result
??????? ), JSON_UNESCAPED_UNICODE);
這個(gè)是使用ci框架
添加回答
舉報(bào)
0/150
提交
取消