SELECT a。*,c.category_name FROM products a JOIN product_categories b ON a.id = b.product_id JOIN类别c ON b.category_id = c.id WHERE a.store_id = 20
答案 0 :(得分:0)
你可以试试这个:
$data = Yii::app()->db->createCommand('Your query here')->queryAll();
var_dump($data);