request->post(); $row = $model->FindById($input['id']); switch ($type) { case 1: if($row->state == 1) { $row->state = 2; } else if($row->state == 2) { $row->state = 1; } break; case 2: $row->del = 2; break; } if($row->save() == true) return true; } }