$model->where(['isdefault'=> 1])->set(['isdefault' => 0])->update();
if( $default== 1) { $model->where(['isdefault'=> 1]) ->set(['isdefault' => 0]) ->update(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)