|
|
|
@ -59,10 +59,14 @@ class EcloudController < ApplicationController
|
|
|
|
|
create_product_params(params['productparas'], ecloud.try(:id)) if params['productparas'].present?
|
|
|
|
|
# 为管理员添加一条记录
|
|
|
|
|
# 开通的时候都是用户的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'])
|
|
|
|
|
# 如果管理员已经存在,则不用重复开通
|
|
|
|
|
euser = EcloudUser.where(id: params['userid'], custid: params['custid']).first
|
|
|
|
|
unless euser
|
|
|
|
|
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'])
|
|
|
|
|
end
|
|
|
|
|
elsif params['opttype'] == 2 # 试用转商用 # 变更企业/个人业务
|
|
|
|
|
# 业务列表:注销业务(注销试用的套餐),另一个业务项的操作代码是:新增业务(开通商用的套餐)
|
|
|
|
|
# 需要通过产品服务编号和业务编码来区分哪个产品
|
|
|
|
|