public function actionDeletePreference(){ $post= Auction::$app->request->post('id'); $post = Json::decode($post,true); if(DealerPreference::model()->deletePreference($post)) { return $this->actionIndex(); } }
/** * @return \yii\db\ActiveQuery */ public function getDealerPreferences() { return $this->hasMany(DealerPreference::className(), ['dealer' => 'id']); }