From e7298c7d6fbcef726701438c189866d03c3bacf9 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 13 Mar 2019 14:02:43 +0800 Subject: [PATCH] ecloud --- app/controllers/ecloud_controller.rb | 6 +++--- db/migrate/20190313055953_add_ecloud_id_to_ecloud_user.rb | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 db/migrate/20190313055953_add_ecloud_id_to_ecloud_user.rb diff --git a/app/controllers/ecloud_controller.rb b/app/controllers/ecloud_controller.rb index ebbd8c1c..33463358 100644 --- a/app/controllers/ecloud_controller.rb +++ b/app/controllers/ecloud_controller.rb @@ -102,10 +102,10 @@ class EcloudController < ApplicationController begin ecloud = Ecloud.where(applyno: params['applyno']).first user_param = params['users'].first - ecloud_user = ecloud.ecloud_user + ecloud_user = EcloudUser.where(ecloud_id: ecloud.id).first - ecloud_user.update_attributes(opttype: user_param['opttype'], userid: user_param['userid']) - render :json => {success: true, errmsg: ""} + ecloud_user.update_attributes(opttype: user_param['opttype'], userid: user_param['userid']) + render :json => {success: true, errmsg: ""} # else # render :json => {code: 404, msg: "企业ID不存在"} # end diff --git a/db/migrate/20190313055953_add_ecloud_id_to_ecloud_user.rb b/db/migrate/20190313055953_add_ecloud_id_to_ecloud_user.rb new file mode 100644 index 00000000..f5ec4815 --- /dev/null +++ b/db/migrate/20190313055953_add_ecloud_id_to_ecloud_user.rb @@ -0,0 +1,5 @@ +class AddEcloudIdToEcloudUser < ActiveRecord::Migration + def change + add_column :ecloud_users, :ecloud_id, :integer + end +end