Blogger Information
Blog 9
fans 0
comment 0
visits 20598
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
thinkphp链表查询获取指定字段
霸霸的博客
Original
3266 people have browsed it

thinkPHP链表查询

实例

$map = ['a.cid' => input('get.id')]; 
$goodsList = Db::table('goods')
           ->alias('a') //goods 表别名
         ->join('brand b','a.bid=b.id') // 连上brand表设置别名b 还有查询条件
         ->field('a.*,b.name brandname') // 获取goods表所有字段以及b表的name字段设置别名brandname
         ->where($map)
         ->paginate(3);


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