/** * Updates an existing SinaFreeze model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id * @return mixed */ public function actionUnlock($id) { $model = $this->findModel($id); $return = sinapay::balanceUnfreeze($model->out_freeze_no, $model->freeze_money, '解冻金额'); if ($return['errorNum'] == 0) { \Yii::$app->getSession()->setFlash('warning', $return['errorMsg']); $info = new Info(); $info->freeze -= $model->freeze_money; $info->balance += $model->freeze_money; $info->save(); } else { \Yii::$app->getSession()->setFlash('warning', $return['errorMsg']); } return $this->redirect(['index']); }