request->isGet()) { $app = AppPayModel::detail($this->getBranchId()); $platform = PlatformEnum::data(); $pay_type = OrderPayTypeEnum::data(); return $this->renderSuccess('', compact('app', 'platform', 'pay_type')); } $model = AppPayModel::detail($this->getBranchId()); if(empty($model)){ $model = new AppPayModel(); } $data = $this->postData(); if(!empty($data['pay_type'])){ foreach ($data['pay_type'] as &$item){ if(!isset($item['pay_type'])){ $item['pay_type'] = []; } } } $data["branch_id"] = $this->getBranchId(); if ($model->editPay($data)) { return $this->renderSuccess('操作成功'); } return $this->renderError($model->getError() ?: '操作失败'); } }