Blogger Information
Blog 40
fans 0
comment 1
visits 39758
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
基于layui和thinkphp数据表格的数据接口
Dong.
Original
2079 people have browsed it

接口程序部分,来源于网络图,但很有用

前端url: ‘/admin.php/Article/lists’

后端

publice function lists(){

$page=$_GET[‘page’];

$limit=$_GET[‘limit’];

…连接数据库…

$count=$db->where(‘is_open=1’)->count();

$list=$db->field(……)->where(……)->page($page,$limit)->select();

//写入JSON

$arr=array();

$arr[‘code’]=0;

$arr[‘msg’]=””;

$arr[‘count’]=$count;

$arr[‘data’]=$list;

$arr_json=json_encode($arr);

echo $arr_json;

}

部分请参考官方手册:layui 接口数据格式

资料来源:http://logofun.ga/2018/07/10/lay_tp_url/

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post