3
我試圖從RestoFoods
模型一樣,刪除數據:Yii2:如何使用deleteAll有兩個條件=,而不是在
RestoFoods::deleteAll(["restaurant_id"=>$postData['resto_id'], 'food_id NOT IN'=> [1,2] ]);
我想這個SQL:
DELETE FROM `resto_foods` WHERE `restaurant_id`=1 AND (`food_id` NOT IN (1, 2));
讓示例更具可讀性 – GergelyPolonkai