diff --git a/app/api/mobile/apis/blockchains.rb b/app/api/mobile/apis/blockchains.rb index ef413ee97..58eb59444 100644 --- a/app/api/mobile/apis/blockchains.rb +++ b/app/api/mobile/apis/blockchains.rb @@ -145,12 +145,11 @@ module Mobile post 'getJoinInfo' do authenticate! # 根据repo_git_url找到repository对应的项目 - Rails.logger.info(params) rs = RepositoriesService.new if params[:ownername] != nil and params[:reponame] != nil owner = User.find_by_login(params[:ownername]) if owner - project = Project.find_by_sql("select * from projects where user_id='#{owner.id}' and name='#{params[:reponame]}'") + project = Project.find_by_user_id_name(owner.id, params[:reponame]) node_ids = BlockchainProjectClient.find_by_sql("select node_id from blockchain_project_clients where project_id='#{project.id}' and user_id='#{current_user.id}'").map(&:node_id) result = {:node_ids => node_ids, :status => status} # 定义变量记录返回值 present result