-1
我怎麼能寫這樣的代碼Yii2-幫助簡單的MySQL更新查詢轉換爲活動記錄代碼
UPDATE tbl_user SET status=null WHERE status=12 and id != 1
到活動記錄代碼 - 水木清華這樣
$model = User::find()
->where(['status' => 12])
->andWhere('id != :id', [':id' => 1])
->all();
$model->status = null;
$model->save();