聚合
ORM 还提供了各种聚合方法,比如 count, max,min, avg,还有 sum。你可以在构造查询后调用任何方法:
max
$max = TestUserListModel::create()->max('age');
min
$min = TestUserListModel::create()->min('age');
count
// count 不必传字段名
$count = TestUserListModel::create()->count();
avg
$avg = TestUserListModel::create()->avg('age');
sum
$sum = TestUserListModel::create()->sum('age');
当前内容版权归 EasySwoole 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 EasySwoole .