BizController::actionUpdate PHP Méthode

actionUpdate() public méthode

修改商家
public actionUpdate ( $id )
    public function actionUpdate($id)
    {
        $model = $this->loadBiz(trim($id));
        $model->setScenario('sell');
        $this->performAjaxValidation($model);
        if (!empty($_POST)) {
            $model->attributes = $_POST['ARBiz'];
            //            dump($_FILES);
            //            控制器中使用实例如下:
            $upload = new FileUpload(array($model, 'license_photo'), 'upload/groupon');
            //model处理文件上传  $upload = new FileUpload(array($model,'pic'),'upload/goods');
            if (!$upload->isNull()) {
                if ($filename = $upload->save()) {
                    $model->license_photo = $filename;
                    //                      dump($filename);
                } else {
                    print_r($upload->getErrors());
                    throw new CHttpException('300', '文件上传失败');
                }
            }
            //            dump($model->attributes);
            if ($model->save()) {
                //                $return_url = $_POST['return_url'];
                $this->redirect(array('index'));
            }
        }
        $this->render('update', array('model' => $model));
    }