dev_hs
hjm 6 years ago
parent 5e4d16ceca
commit e07baf9f3d

@ -100,12 +100,7 @@ class CoursesController < ApplicationController
# GET /courses/new
def new
@course = Course.new
unless params[:subject_id].blank?
subject = Subject.find_by(id: params[:subject_id], excellent: 1)
render :json => {status: 0, course_name: "#{subject&.name}#{subject&.courses&.count.to_i + 1}"}
else
normal_status("成功")
end
normal_status("成功")
end
# Get /courses/:id/settings

@ -564,7 +564,7 @@ class ShixunsController < ApplicationController
if StageShixun.exists?(shixun_id: @shixun.id, subject_id: Subject.where(excellent: 1))
subject = Subject.find_by(id: StageShixun.where(shixun_id: @shixun.id).pluck(:subject_id), excellent: 1)
subject = Subject.where(id: StageShixun.where(shixun_id: @shixun.id).pluck(:subject_id), excellent: 1).take(1)
course = subject.courses.where("start_date is not null and start_date <= '#{Date.today}' and end_date is not null and end_date >= '#{Date.today}'").take
if course.present? && !CourseMember.exists?(course_id: course.id, user_id: current_user.id)
# 为了不影响后续操作用create而不是create!

@ -620,8 +620,8 @@ class DetailCardsEditAndAdd extends Component{
</div>
}
{this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_statistics===true?editPanel===false?<div className="click_add color-grey-9" onClick={this.addStage}>
<span className="color-blue_4C">+点击新建阶段</span>1
{this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_statistics===true?editPanel===false?<div className="click_add color-grey-9">
<span className="color-blue_4C" onClick={this.addStage}>+点击新建阶段</span>1
</div>:'':''}
</div>
)

@ -68,11 +68,10 @@ class OpenCourse extends Component {
<div className={"tabeltext-alignleft"}>
<p className={"mt20 mb20 font-16"}>
<Radio.Group onChange={this.setpathradioChange} value={this.state.value}>
<Radio style={pathradioStyle} value={1} className={"mt10"}>
<Radio style={pathradioStyle} value={1}>
开放课堂<span style={pathradioStyles}>所有用户可以随时访问</span>
</Radio>
<Radio style={pathradioStyle} value={0} className={"mt10"}>
<Radio style={pathradioStyle} value={0}>
私有课堂<span style={pathradioStyles}>仅报名参与的课堂成员可以访问</span>
</Radio>
</Radio.Group>

@ -542,7 +542,7 @@ class PathDetailIndex extends Component{
{
detailInfoList===undefined?"":detailInfoList.allow_add_member===true? <div>
{key!=0?<div className="fr ml15 flex1"><a onClick={()=>this.moveup(item)}><Tooltip title="上移"><i className="color-green font-18 iconfont icon-xiangshangyi"></i></Tooltip></a></div>:""}
{key+1=== members.length?"":<div className="fr ml15 flex1 "><a onClick={()=>this.movedown(item)}><Tooltip title="下移"><i className="color-green font-18 iconfont icon-xiangxiayi"></i></Tooltip></a></div>}
{key+1!= members&&members.length?<div className="fr ml15 flex1 "><a onClick={()=>this.movedown(item)}><Tooltip title="下移"><i className="color-green font-18 iconfont icon-xiangxiayi"></i></Tooltip></a></div>:""}
</div>
:""
}

Loading…
Cancel
Save