```
应用:当a(新闻表)表的类别与b(类别表)表的id相等时,
查询出a(新闻表)表的所有信息和b(类别表)表的所有信息
$news = Db::name("news")
->field("b.title as category_name,a.*")//查出a的所有,b的title取名 category_name
->alias("a") //news表名取别名a
->leftJoin("category b","a.category=b.id") //category表名取b,条件:a.category=b.id
->where($where) //条件
->order("a.id","desc")
->paginate($pageSize,false,["query"=>$pagecon]);
```
对应的sql:
` SELECT a.*,b.id FROM jxwlrl_news a inner JOIN jxwlrl_category b on a.category=b.id`