예제 #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getDealerCompanyPreferences()
 {
     return $this->hasMany(DealerCompanyPreferences::className(), ['brand' => 'id']);
 }
예제 #2
0
    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();
    }