yii2:多表查询

啥都不说了,上代码:

$list = static::find()
                    ->leftJoin('book',
                        'book.RID = prices.RID')->select('prices.*,book.WCONTENT,book.WIMGURL,book.WURL')
                    ->andFilterWhere(['prices.WMODEL'=> $where_condition['WMODEL']])
                    ->andFilterWhere(['prices.WTYPE'=> $where_condition['WTYPE']])
                    ->offset($params['offset'])
                    ->orderBy(['prices.WCREATETIME' => SORT_DESC])->limit($params['limit'])->asArray()->all();

  

原文地址:https://www.cnblogs.com/achengmu/p/6729195.html