dev_shixuns
huang 6 years ago
parent ed08c76021
commit e9fe238b02

@ -71,7 +71,7 @@ class EcloudController < ApplicationController
# 注销试用的套餐 # 注销试用的套餐
## 需要注销的套餐; 试用转商用是不会有批量操作的所以可以使用first ## 需要注销的套餐; 试用转商用是不会有批量操作的所以可以使用first
des_service = params['services'].select{|s| s['opttype'] == 1}.first des_service = params['services'].select{|s| s['opttype'] == 1}.first
esd = EcloudService.where(ecloud_id: ecloud.try(:id), code: des_service['code'], productcode: params['productcode']).first esd = EcloudService.where(ecloud_id: ecloud.try(:id), code: des_service['code']).first
ecloud.update_attribute(:trial, params['trial']) ecloud.update_attribute(:trial, params['trial'])
esd.update_attributes!(opttype: des_service['opttype'], begintime: des_service['begintime'], endtime: des_service['endtime']) esd.update_attributes!(opttype: des_service['opttype'], begintime: des_service['begintime'], endtime: des_service['endtime'])

Loading…
Cancel
Save