PHP完全自学手册(珍藏版) 中文pdf扫描版下载
PriceAlert::find()
->joinWith('product')
->andWhere(['user_id' => Yii::$app->user->id])
->andWhere(['>', 'product.price', 100])
->orderBy('complete DESC, updated_at DESC')
->all();
或
PriceAlert::find()
->joinWith(['product' => function ($q) {
// add conditions here
}])
->andWhere(['user_id' => Yii::$app->user->id])
->orderBy('complete DESC, updated_at DESC')
->all();
转载请注明:谷谷点程序 » yii2 joinWith() with()用法