Yii查询怎么返回结果的条数

2025-05-08 18:25:14
推荐回答(1个)
回答1:

使用count函数,如下:

$count = Model::find()->where(['id'=>123])->count();