From ae69f82d730b7dff614f2ab3249364b994e9280d Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 14 Mar 2019 16:13:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=90=84=E7=A7=8D=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/ecloud_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/ecloud_controller.rb b/app/controllers/ecloud_controller.rb index c732a954..650e54f0 100644 --- a/app/controllers/ecloud_controller.rb +++ b/app/controllers/ecloud_controller.rb @@ -59,7 +59,12 @@ class EcloudController < ApplicationController ecloud = Ecloud.create!(eloud_params) create_service(params['services'], ecloud.try(:id)) create_product_params(params['productparas'], ecloud.try(:id)) if params['productparas'].present? - # REDO为管理员添加一条记录 + # 为管理员添加一条记录 + # 开通的时候都是用户的opttype也是0 + EcloudUser.create!(custid: params['custid'], opttype: params['opttype'], userid: params['userid'], + username: params['username'], useralias: params['useralias'], + mobile: params['mobile'], email: params['email'], begintime: params['begintime'], + endtime: params['endtime']) elsif params['opttype'] == 2 # 试用转商用 # 变更企业/个人业务 # 业务列表:注销业务(注销试用的套餐),另一个业务项的操作代码是:新增业务(开通商用的套餐) # 需要通过产品服务编号和业务编码来区分哪个产品 @@ -76,6 +81,7 @@ class EcloudController < ApplicationController # 新增业务 add_service = params['services'].select{|s| s['opttype'] == 0} create_service(add_service, ecloud.try(:id)) + # elsif params['opttype'] == 1 # 业务变更 ecloud = Ecloud.where(custid: params['custid'], custcode: params['custcode'], productcode: params['productcode']).first