0
如何建立在 「CActiveDataProvider」 這個查詢:與CActiveDataProvider簡單的查詢 - Yii框架
$var = word;
SELECT table_a.name, table_b.name
FROM table_a
LEFT JOIN table_b ON table_a.id = table_b.bid
WHERE table_a.name LIKE '%$var%'
我到目前爲止這種模式:
class Table_a extends CActiveRecord {
public static function model($className=__CLASS__) {
return parent::model($className);
}
public function tableName() {
return Yii::app()->db->tablePrefix.'table_a';
}
}