浏览代码

Merge branch 'dev2.6.2' of http://192.168.3.207:10080/qmx/qfw into dev2.6.2

xuzhiheng 5 年之前
父节点
当前提交
2e6c563e3b
共有 2 个文件被更改,包括 29 次插入24 次删除
  1. 15 11
      core/src/qfw/manage/course.go
  2. 14 13
      core/src/web/templates/manage/course/content.html

+ 15 - 11
core/src/qfw/manage/course.go

@@ -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}
 				}

+ 14 - 13
core/src/web/templates/manage/course/content.html

@@ -44,6 +44,7 @@
             margin-right: -20px !important;
             margin-top: -8px !important;
         }
+
         /*修改弹框样式*/
         .modal {
             top: 33%;
@@ -74,12 +75,12 @@
 
         }
 
-        .modal-dialog .modal-footer{
+        .modal-dialog .modal-footer {
             display: flex;
             justify-content: space-between;
         }
 
-        .modal-dialog .modal-footer .bootbox-cancel{
+        .modal-dialog .modal-footer .bootbox-cancel {
             width: 110px;
             height: 38px;
             left: 24px;
@@ -91,7 +92,7 @@
             color: #ffff;
         }
 
-        .modal-dialog .modal-footer .bootbox-accept{
+        .modal-dialog .modal-footer .bootbox-accept {
             width: 110px;
             height: 38px;
             left: 226px;
@@ -163,18 +164,18 @@
                                 <div class="col-sm-5" id="fbt">
                                     <input style="background:#fff url({{Msg "seo" "cdn"}}/images/datePicker.gif) no-repeat right;"
                                            id="courseStart" datatype="*"
-                                           onFocus="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd'})"
+                                           onFocus="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                            type="text" class="form-control" placeholder="请选择课程开始时间"
-                                           onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="ture"
+                                           onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="ture"
                                            value="{{.T.starttime}}"/>
 
                                 </div>
                                 <div class="col-sm-5" id="fbt">
                                     <input style="background:#fff url({{Msg "seo" "cdn"}}/images/datePicker.gif) no-repeat right;"
                                            id="courseEnd" datatype="*"
-                                           onFocus="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd'})"
+                                           onFocus="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                            type="text" class="form-control" placeholder="请选择课程结束时间"
-                                           onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="ture"
+                                           onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="ture"
                                            value="{{.T.endtime}}"/>
 
                                 </div>
@@ -305,7 +306,7 @@
         c_type = $("#courseType").val();
         name = $("#courseName").val();
         address = $("#courseAddress").val();
-        price = $("#coursePrice").val();
+        price = parseInt(($("#coursePrice").val() * 100).toFixed(2));
         starttime = $("#courseStart").val();
         endtime = $("#courseEnd").val();
         publishtime = $("#coursePushtime").val();
@@ -336,14 +337,14 @@
             dotype: Dotype, //克隆 or 新增 or 修改
             flag: flag//保存 or 立即发布
         }
-		
+
         if (Dotype == "edit" && id != "") {
             param["_id"] = id
         }
-		console.log(DiscountPlan[c_type])
-		if(DiscountPlan[c_type]){
-			param["discountPlan"] = JSON.stringify(DiscountPlan[c_type])
-		}
+        console.log(DiscountPlan[c_type])
+        if (DiscountPlan[c_type]) {
+            param["discountPlan"] = JSON.stringify(DiscountPlan[c_type])
+        }
         console.log(param.content)
         $.post("/manage/course/doRequest", param, function (r) {
             if (r.success) {