\think\db\concernAggregateQuery

聚合查询

Summary

Methods
Properties
Constants
count()
sum()
min()
max()
avg()
No public properties found
No constants found
aggregate()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

count()

count(string|\think\db\Raw  $field = '*') : int

COUNT查询

Parameters

string|\think\db\Raw $field

字段名

Returns

int —

sum()

sum(string|\think\db\Raw  $field) : float

SUM查询

Parameters

string|\think\db\Raw $field

字段名

Returns

float —

min()

min(string|\think\db\Raw  $field, bool  $force = true) : mixed

MIN查询

Parameters

string|\think\db\Raw $field

字段名

bool $force

强制转为数字类型

Returns

mixed —

max()

max(string|\think\db\Raw  $field, bool  $force = true) : mixed

MAX查询

Parameters

string|\think\db\Raw $field

字段名

bool $force

强制转为数字类型

Returns

mixed —

avg()

avg(string|\think\db\Raw  $field) : float

AVG查询

Parameters

string|\think\db\Raw $field

字段名

Returns

float —

aggregate()

aggregate(string  $aggregate, string|\think\db\Raw  $field, bool  $force = false) : mixed

聚合查询

Parameters

string $aggregate

聚合方法

string|\think\db\Raw $field

字段名

bool $force

强制转为数字类型

Returns

mixed —