I have got a table shop
and shop_prices
.
table shop
: id, name. Table shop_prices
: id, shop_id, car, price.
How can i select the minimum price for each shop.
In car model i have defined criteria
$criteria=new CDbCriteria;
$criteria->with=array('carsprices');
Then i render it via dataprovider.
Question: 1. how to select minimal prices for each shop? 2. and then i want to limit it, ie I will set maximun price and then limit minimal prices via it.