|
@@ -159,13 +159,13 @@ func (this *CourseManage) OrderList() {
|
|
|
if a_id != "" {
|
|
|
a_id += ","
|
|
|
}
|
|
|
- a_id += qutil.BsonIdToSId(v["_id"])
|
|
|
+ a_id += "'" + qutil.BsonIdToSId(v["_id"]) + "'"
|
|
|
}
|
|
|
- sql += ` and filter_id in (` + a_id + `')`
|
|
|
+ sql += ` and filter_id in (` + a_id + `)`
|
|
|
} else if c_type == "0" {
|
|
|
sql += ` and order_code ='` + c_content + `'`
|
|
|
} else if c_type == "2" {
|
|
|
- sql += ` and user_nickname ='` + c_content + `'`
|
|
|
+ sql += ` and filter like '%"name":"` + c_content + `"%'`
|
|
|
} else if c_type == "3" {
|
|
|
sql += ` and user_phone ='` + c_content + `'`
|
|
|
}
|
|
@@ -231,8 +231,8 @@ func (this *CourseManage) CreatePage(flag, id string) error {
|
|
|
this.T["price"] = (*rData)["i_price"]
|
|
|
|
|
|
this.T["publishtime"] = time.Unix(qutil.Int64All((*rData)["l_publishtime"]), 0).Format(qutil.Date_Full_Layout)
|
|
|
- this.T["starttime"] = time.Unix(qutil.Int64All((*rData)["l_starttime"]), 0).Format(qutil.Date_Short_Layout)
|
|
|
- this.T["endtime"] = time.Unix(qutil.Int64All((*rData)["l_endtime"]), 0).Format(qutil.Date_Short_Layout)
|
|
|
+ this.T["starttime"] = time.Unix(qutil.Int64All((*rData)["l_starttime"]), 0).Format(qutil.Date_Full_Layout)
|
|
|
+ this.T["endtime"] = time.Unix(qutil.Int64All((*rData)["l_endtime"]), 0).Format(qutil.Date_Full_Layout)
|
|
|
this.T["content"] = (*rData)["s_content"]
|
|
|
this.T["status"] = (*rData)["i_status"]
|
|
|
this.T["id"] = id
|
|
@@ -246,7 +246,7 @@ func (this *CourseManage) CreateApi() {
|
|
|
c_type, _ := this.GetInteger("c_type") //课程类型
|
|
|
name := this.GetString("name")
|
|
|
address := this.GetString("address")
|
|
|
- price, _ := this.GetFloat("price")
|
|
|
+ price, _ := this.GetInt("price")
|
|
|
s_starttime := this.GetString("starttime")
|
|
|
s_endtime := this.GetString("endtime")
|
|
|
s_publishtime := this.GetString("publishtime")
|
|
@@ -268,11 +268,13 @@ func (this *CourseManage) CreateApi() {
|
|
|
if err != nil {
|
|
|
return &FuncResult{false, errors.New("发布时间异常"), nil}
|
|
|
}
|
|
|
- starttime, err := time.ParseInLocation(qutil.Date_Short_Layout, s_starttime, time.Local)
|
|
|
+ log.Println("start:", s_starttime)
|
|
|
+ starttime, err := time.ParseInLocation(qutil.Date_Full_Layout, s_starttime, time.Local)
|
|
|
if err != nil {
|
|
|
return &FuncResult{false, errors.New("课程时间异常"), nil}
|
|
|
}
|
|
|
- endtime, err := time.ParseInLocation(qutil.Date_Short_Layout, s_endtime, time.Local)
|
|
|
+ log.Println("s_endtime:", s_endtime)
|
|
|
+ endtime, err := time.ParseInLocation(qutil.Date_Full_Layout, s_endtime, time.Local)
|
|
|
if err != nil {
|
|
|
return &FuncResult{false, errors.New("课程时间异常"), nil}
|
|
|
}
|
|
@@ -288,7 +290,7 @@ func (this *CourseManage) CreateApi() {
|
|
|
if err != nil {
|
|
|
return &FuncResult{false, errors.New("课程内容解析异常"), nil}
|
|
|
}
|
|
|
- if !(qutil.IntAll(price*100) > 0) {
|
|
|
+ if !(price > 0) {
|
|
|
return &FuncResult{false, errors.New("课程金额异常"), nil}
|
|
|
}
|
|
|
//数据校验
|
|
@@ -296,7 +298,7 @@ func (this *CourseManage) CreateApi() {
|
|
|
"s_name": name,
|
|
|
"i_type": c_type,
|
|
|
"s_address": address,
|
|
|
- "i_price": qutil.IntAll(price * 100),
|
|
|
+ "i_price": price,
|
|
|
"l_publishtime": publishtime.Unix(),
|
|
|
"l_starttime": starttime.Unix(),
|
|
|
"l_endtime": endtime.Unix(),
|
|
@@ -366,7 +368,9 @@ func (this *CourseManage) ChangeStatus() {
|
|
|
}, &map[string]interface{}{
|
|
|
"$set": bson.M{"i_status": -1},
|
|
|
}, false, false)
|
|
|
-
|
|
|
+ //通过课程id查询该课程相关的订单
|
|
|
+ var updateSql = `UPDATE dataexport_order SET order_status = -2 WHERE order_status = 0 AND product_type = '招投标课程' AND filter_id = '` + _id + `'`
|
|
|
+ go cutil.Mysql.UpdateOrDeleteBySql(updateSql)
|
|
|
if ok {
|
|
|
return &FuncResult{true, nil, nil}
|
|
|
}
|