|
@@ -496,6 +496,8 @@ func (this *CourseManage) CreateOnLineApi() {
|
|
|
price = "0"
|
|
|
}
|
|
|
price2 := fmt.Sprintf("%.2f", qutil.Float64All(price))
|
|
|
+ pos := strings.Index(price2, ".")
|
|
|
+ price3 := qutil.Int64All(price2[:pos] + price2[pos+1:])
|
|
|
videoUrl := this.GetString("videoUrl")//课程视频
|
|
|
fileUrl := this.GetString("fileUrl")//课件
|
|
|
s_publishtime := this.GetString("publishtime")//发布时间/上线时间
|
|
@@ -543,7 +545,7 @@ func (this *CourseManage) CreateOnLineApi() {
|
|
|
"s_picUrl": picUrl,
|
|
|
"s_videoUrl": videoUrl,
|
|
|
"s_fileUrl": fileUrl,
|
|
|
- "i_price": price2,
|
|
|
+ "i_price": price3,
|
|
|
"l_publishtime": publishtime.Unix(),
|
|
|
//"l_createtime": createTime,
|
|
|
"l_endtime": l_endTime.Unix(),
|
|
@@ -741,16 +743,18 @@ func (this *CourseManage) OnLineDetail(flag, id string) error{
|
|
|
this.T["name"] = (*rData)["s_name"]
|
|
|
this.T["videoUrl"] = (*rData)["s_videoUrl"]
|
|
|
this.T["fileUrl"] = (*rData)["s_fileUrl"]
|
|
|
- this.T["price"] = (*rData)["i_price"]
|
|
|
+ this.T["price"] = fmt.Sprintf("%.2f", qutil.Float64All((*rData)["i_price"])/100)
|
|
|
this.T["endTime"] = time.Unix(qutil.Int64All((*rData)["l_endtime"]), 0).Format(qutil.Date_Full_Layout)
|
|
|
this.T["courseDate"] = (*rData)["s_courseDate"]
|
|
|
this.T["content"] = (*rData)["s_content"]
|
|
|
this.T["status"] = (*rData)["i_status"]
|
|
|
ids := (*rData)["s_associatedCourses"]
|
|
|
- arr := strings.Split(ids.(string), ",")
|
|
|
var idSlice []bson.ObjectId
|
|
|
- for _, as := range arr{
|
|
|
- idSlice = append(idSlice, bson.ObjectIdHex(as))
|
|
|
+ if ids != "" {
|
|
|
+ arr := strings.Split(ids.(string), ",")
|
|
|
+ for _, as := range arr{
|
|
|
+ idSlice = append(idSlice, bson.ObjectIdHex(as))
|
|
|
+ }
|
|
|
}
|
|
|
now := time.Now().Unix()
|
|
|
queryAbout := bson.M{"i_type": 3, "i_status": 1, "_id": bson.M{"$in":idSlice}, "l_publishtime": bson.M{"$lt":now}, "l_endtime": bson.M{"$gt":now}}
|