public function actionTest(){ //删除 //方法一 $result = Test::find()->where(['id' => 1])->all(); $result[0]->delete(); //方法二 Test::deleteAll('id>:id', array(':id' => 5)); }
public function actionTest(){ //删除 //方法一 $result = Test::find()->where(['id' => 1])->all(); $result[0]->delete(); //方法二 Test::deleteAll('id>:id', array(':id' => 5)); }
转载于:https://www.cnblogs.com/gyfluck/p/9101128.html