PHP开发实例大全(提高卷) 中文完整pdf扫描版[244MB]
class Likes extends \yii\db\ActiveRecord. $query = Video::find() ->select(['video.*', 'COUNT(likes.video_id) AS countlike']) ->join('LEFT JOIN', Likes::tableName(), 'videos.id=likes.video_id') ->groupBy('videos.id') ->orderBy(['countlike' => SORT_DESC]) ->limit(10); $data = $query->all();
转载请注明:谷谷点程序 » yii2.0 count的使用方法