限时免费试用:欢迎注册 api.bigmodel.org ,快速体验大模型 API 接入服务。
当前位置:首页 >开发者 >网站框架 >前端框架 >Layui

layui-table-ajax-php显示数据

分类:Layui时间:2019-02-25浏览:3314
public function cp_list()
{

    if ($this->request->isAjax()) {
        $map = [];
        $keyword = $this->request->param('keyword');
        $page = $this->request->param('page/d', 1);
        $limit = $this->request->param('limit/d', 20);
        if ($keyword) {
             $map["name"] = ['like', '%'.$keyword.'%'];
        }
        $data['data'] = model('products')->alias('a')
            ->field('a.*,b.nick as store')
            ->join('dianpu b','a.sid=b.id','left')
            ->where($map)->page($page)->limit($limit)->order("id desc")->select();
        //echo db('products')->getLastSql();
        $data['count'] = model('products')->where($map)->count('id');
        $data['code'] = 0;
        return json($data);
    }

    return $this->fetch();
}




{include file="block/layui" /}
本站文章如未注明出处均为原创,转载请注明出处,如有侵权请邮件联系站长。
0/500
Share your thoughts respectfully.