/** * @return \yii\db\ActiveQuery */ public function getDealerCompanyPreferences() { return $this->hasMany(DealerCompanyPreferences::className(), ['brand' => 'id']); }
public function actionDeletePreference(){ $post= Auction::$app->request->post('id'); $post = Json::decode($post,true); DealerCompanyPreferences::find()->where([ 'dc_id' => $post['dc_id'], 'category' => $post['category'], 'brand' => $post['brand'] ])->one()->delete(); return $this->actionIndex(); }