dev_aliyun
jingquan huang 6 years ago
commit b09ef90129

@ -35,7 +35,7 @@ module Mobile
ip = @env['HTTP_X_REAL_IP']
ua = UserAgent.find_by_ip(ip)
if ua.blank?
UserAgent.create!(:key => params[:edu].strip, :ip => ip, :type => UserAgent::AD)
UserAgent.create!(:key => params[:edu].strip, :ip => ip, :agent_type => UserAgent::USER_AD)
end
end
MemosService.new.show params, current_user

@ -380,7 +380,7 @@ class AccountController < ApplicationController
# 注册时,记录是否是引流用户
ip = request.remote_ip
ua = UserAgent.find_by_ip(ip)
ua.update_column(:type, UserAgent::REGISTER) if ua
ua.update_column(:agent_type, UserAgent::USER_REGISTER) if ua
if !@user.new_record?
self.logged_user = @user
flash[:notice] = l(:notice_account_activated)

@ -51,7 +51,7 @@ class CompetitionTeamsController < ApplicationController
end
condition = "%#{params[:search].strip}%".gsub(" ","")
@teachers = User.joins(:user_extensions).where("status = 1 and LOWER(concat(lastname, firstname, login, nickname)) LIKE '#{condition}' and user_extensions.identity = 0")
@teachers = User.joins(:user_extensions).where("status = 1 and LOWER(concat(lastname, firstname, login, nickname)) LIKE '#{condition}' and user_extensions.identity = 0").limit(20)
end
def search_non_user
@ -71,7 +71,7 @@ class CompetitionTeamsController < ApplicationController
end
user_ids = user_ids.length > 0 ? "(" + user_ids.uniq.join(',') + ")" : "(-1)"
condition = "%#{params[:search].strip}%".gsub(" ","")
@users = User.joins(:user_extensions).where("users.id not in #{user_ids} and status = 1 and user_extensions.identity = 1 and LOWER(concat(lastname, firstname, login, nickname)) LIKE '#{condition}'")
@users = User.joins(:user_extensions).where("users.id not in #{user_ids} and status = 1 and user_extensions.identity = 1 and LOWER(concat(lastname, firstname, login, nickname)) LIKE '#{condition}'").limit(20)
end
def create
@ -350,6 +350,6 @@ class CompetitionTeamsController < ApplicationController
# 记录是否是引流用户的行为
ip = request.remote_ip
ua = UserAgent.find_by_ip(ip)
ua.update_column(:type, UserAgent::COMPETITION) if ua
ua.update_column(:agent_type, UserAgent::USER_COMPETITION) if ua
end
end

@ -1,6 +1,6 @@
class UserAgent < ActiveRecord::Base
AD = 1 # 广告宣传的引流
REGISTER = 2 # 引流注册
COMPETITION = 3 # 引流参加竞赛
USER_AD = 1 # 广告宣传的引流
USER_REGISTER = 2 # 引流注册
USER_COMPETITION = 3 # 引流参加竞赛
end

@ -8,7 +8,6 @@
bottom: 0px;
right: 0px;
}
ddd
</style>
<div class="educontent newLogipopup" id="backImg" >
<div class="pr edu-txt-center height-100 pt110">
@ -18,15 +17,6 @@ ddd
<img src="/images/educoder/competitionslog.png" height="600px" width="600px" />
<img height="600px" width="600px" src="/images/educoder/applys.png" />
</div>
<!--第三方账号登录-->
<!--<div class="mt10 edu-txt-center">
<p class="color-grey-9">第三方账号登录</p>
<div class="mt15">
<a href="javascript:void(0)" class="margin15"><img src="/images/educoder/weixin.png" class="radius"/></a>
<a href="javascript:void(0)" class="margin15"><img src="/images/educoder/QQ.png" class="radius"/></a>
<a href="javascript:void(0)" class="margin15"><img src="/images/educoder/weibo.png" class="radius"/></a>
</div>
</div>-->
</div>
</div>
</div>

@ -73,7 +73,7 @@
<div class="surfacePlot ml25 library-cover-select" data-tip-down="上传图片" onclick="$('#library-cover-file').click();">
<img src="/images/educoder/unite.png" class="marginuploading <%= cover_exists ? 'hidden' : '' %>" style="<%= cover_exists ? 'display:none' : '' %>"/>
<div class="library-cover-perview" style="<%= cover_exists ? '' : 'display:none' %>">
<% cover_url = cover_exists ? named_attachment_path(@library.cover.id, @library.cover.filename) : '' %>
<% cover_url = cover_exists ? download_attachment_path(@library.cover_id) : '' %>
<img src="<%= cover_url %>" width="120px" height="90px"/>
</div>
</div>

@ -0,0 +1,8 @@
class ModifyTypeForUserAgents < ActiveRecord::Migration
def up
rename_column :user_agents, :type, :agent_type
end
def down
end
end
Loading…
Cancel
Save