\think\db\concernJoinAndViewQuery

JOIN和VIEW查询

Summary

Methods
Properties
Constants
join()
leftJoin()
rightJoin()
fullJoin()
view()
No public properties found
No constants found
getJoinTable()
parseView()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

join()

join(mixed  $join, mixed  $condition = null, string  $type = 'INNER', array  $bind = []) : $this

查询SQL组装 join

Parameters

mixed $join

关联的表名

mixed $condition

条件

string $type

JOIN类型

array $bind

参数绑定

Returns

$this —

leftJoin()

leftJoin(mixed  $join, mixed  $condition = null, array  $bind = []) : $this

LEFT JOIN

Parameters

mixed $join

关联的表名

mixed $condition

条件

array $bind

参数绑定

Returns

$this —

rightJoin()

rightJoin(mixed  $join, mixed  $condition = null, array  $bind = []) : $this

RIGHT JOIN

Parameters

mixed $join

关联的表名

mixed $condition

条件

array $bind

参数绑定

Returns

$this —

fullJoin()

fullJoin(mixed  $join, mixed  $condition = null, array  $bind = []) : $this

FULL JOIN

Parameters

mixed $join

关联的表名

mixed $condition

条件

array $bind

参数绑定

Returns

$this —

view()

view(string|array  $join, string|array  $field = true, string  $on = null, string  $type = 'INNER', array  $bind = []) : $this

指定JOIN查询字段

Parameters

string|array $join

数据表

string|array $field

查询字段

string $on

JOIN条件

string $type

JOIN类型

array $bind

参数绑定

Returns

$this —

getJoinTable()

getJoinTable(array|string|\think\db\Raw  $join, string  $alias = null) : string|array

获取Join表名及别名 支持 ['prefix_table或者子查询'=>'alias'] 'table alias'

Parameters

array|string|\think\db\Raw $join

JION表名

string $alias

别名

Returns

string|array —

parseView()

parseView(array  $options) : void

视图查询处理

Parameters

array $options

查询参数