Menggunakan having()
// Produk paling banyak dibeli
$mostPopular = Product::find()
->select(['product.*','count(order_item.id) as jumlah_terjual'])
->joinWith(['orderItems'])
->groupBy('product.id')
->having('jumlah_terjual > 0')
->createCommand()
->queryAll(\PDO::FETCH_OBJ);