Beispiel #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPrices()
 {
     return $this->hasMany(Prices::className(), ['price_type_id' => 'id']);
 }
Beispiel #2
0
 public function getProductsPrices()
 {
     return $this->hasOne(Prices::className(), ['product_id' => 'id'])->joinWith(['priceType' => function ($query) {
         return $query->where('status = :status', ['status' => PriceTypes::STATUS_DEFAULT_PRICE]);
     }]);
 }