ecloud_user添加status标记

dev_SaaS
huang 6 years ago
parent 7e168f42a6
commit 5113d5cb36

@ -86,11 +86,11 @@ class EcloudController < ApplicationController
# if ecloud_user.present?
# render :json => {code: 500, msg: "你已开通过该业务"}
# else
EcloudUser.create!(custid: params['custid'], opttype: user_param['opttype'], userid: user_param['userid'],
username: user_param['username'], useralias: user_param['useralias'],
mobile: user_param['mobile'], email: user_param['email'], begintime: user_param['begintime'].to_s,
endtime: user_param['endtime'].to_s)
render :json => {success: true, errmsg: ""}
EcloudUser.create!(custid: params['custid'], opttype: user_param['opttype'], userid: user_param['userid'],
username: user_param['username'], useralias: user_param['useralias'],
mobile: user_param['mobile'], email: user_param['email'], begintime: user_param['begintime'].to_s,
endtime: user_param['endtime'].to_s, status: 1)
render :json => {success: true, errmsg: ""}
# end
rescue Exception => e
logger.error(e.message)
@ -103,9 +103,9 @@ class EcloudController < ApplicationController
begin
ecloud = Ecloud.where(applyno: params['applyno']).first
user_param = params['users'].first
ecloud_user = EcloudUser.where(ecloud_id: ecloud.id).first
ecloud_user = EcloudUser.where(userid: user_param['userid'], status: 0).first
ecloud_user.update_attributes(opttype: user_param['opttype'], userid: user_param['userid'])
ecloud_user.update_attributes(opttype: user_param['opttype'], userid: user_param['userid'], status: 0)
render :json => {success: true, errmsg: ""}
# else
# render :json => {code: 404, msg: "企业ID不存在"}

@ -1,3 +1,3 @@
class EcloudUser < ActiveRecord::Base
attr_accessible :begintime, :email, :endtime, :mobile, :opttype, :paras, :useralias, :userid, :username, :custid
attr_accessible :begintime, :email, :endtime, :mobile, :opttype, :paras, :useralias, :userid, :username, :custid, :status, :ecloud_id
end

@ -0,0 +1,5 @@
class AddStatusToEcloudUser < ActiveRecord::Migration
def change
add_column :ecloud_users, :status, :integer, :limit => 1
end
end
Loading…
Cancel
Save