In AR Model Relations you can add multiple ON condition using
andOnCondition
method.
public function getInvoiceItem(){
return $this->hasOne(Invoice::className(), ['order_no' => 'order_no'])
->andOnCondition(['item' => $this->order_item])
->andOnCondition(['user_id' => $this->user_id]);
}
No comments:
Post a Comment