Explorar o código

订单删除 和 客户端分销弹窗

wangshan %!s(int64=5) %!d(string=hai) anos
pai
achega
1ed5cc11bd

+ 73 - 0
src/jfw/modules/app/src/app/front/jylog.go

@@ -0,0 +1,73 @@
+package front
+
+/**
+日志文件自动切换,默认保留15天内日志
+**/
+
+import (
+	"log"
+	"os"
+	"path/filepath"
+	"regexp"
+	"time"
+
+	"github.com/go-xweb/xweb"
+	"github.com/robfig/cron"
+)
+
+//日志格式
+var fileReg = regexp.MustCompile("^(\\d{4}_[0-9_]{14})\\.log$")
+
+//当前日志文件句柄
+var LogFile *os.File
+
+//时间格式
+var FMT = "2006_01_02_15_04_05"
+
+//日志目录
+var LogPath = "./jylog"
+
+func init() {
+	os.Mkdir(LogPath, os.ModePerm)
+	//默认保留15天内的日志,-1为永久保留
+	initLog(15)
+}
+
+func initLog(saveDay int) {
+	go logfile()
+	task := cron.New()
+	task.Start()
+	task.AddFunc("0 0 0 * * ?", func() {
+		go logfile()
+		time.Sleep(50 * time.Second)
+		if saveDay > 0 {
+			filepath.Walk(LogPath, func(path string, info os.FileInfo, err error) error {
+				str := fileReg.FindStringSubmatch(info.Name())
+				if len(str) == 2 {
+					t, er := time.ParseInLocation(FMT, str[1], time.Local)
+					if er == nil {
+						if (time.Now().Unix()-t.Unix())/86400 > int64(saveDay) {
+							log.Println("delete log file:", path, os.Remove(path))
+						}
+					}
+				}
+				return nil
+			})
+		}
+	})
+}
+
+//创建并切换输出文件
+func logfile() {
+	now := time.Now().Format(FMT)
+	file, _ := os.Create(LogPath + "/" + now + ".log")
+	log.SetOutput(file)
+	xweb.RootApp().Logger.SetOutput(file)
+	go func(file *os.File) {
+		time.Sleep(5 * time.Second)
+		if LogFile != nil {
+			LogFile.Close()
+		}
+		LogFile = file
+	}(file)
+}

+ 1 - 8
src/jfw/modules/app/src/web/staticres/jyapp/js/common.js

@@ -1255,14 +1255,7 @@ function getParam(name) {
 var tipFlag = true;
 var tipFlag = true;
 function distribInfo(tt){
 function distribInfo(tt){
 	var myHref = window.location.href;
 	var myHref = window.location.href;
-	alert(myHref+"--:"+tt)
-//	if (myHref.indexOf("free/login")>-1&&(myHref.indexOf("appUrl=")>-1||myHref.indexOf("url=")>-1)){
-//		//清除客户端粘贴板
-//		try{
-//			JyObj.clearRight();
-//		}catch(e){}
-//		return false
-//	}
+//	alert(myHref+"--:"+tt)
 	if (tt!=""&&tt.indexOf("复制")>-1&&tt.indexOf("剑鱼标讯")>-1){
 	if (tt!=""&&tt.indexOf("复制")>-1&&tt.indexOf("剑鱼标讯")>-1){
 		var tt_last = tt.split(":")[1]//汉语:
 		var tt_last = tt.split(":")[1]//汉语:
 		var discored = tt_last.split(",")[0]//汉语,获取口令
 		var discored = tt_last.split(",")[0]//汉语,获取口令

+ 9 - 9
src/jfw/modules/subscribepay/src/service/orderListDetails.go

@@ -40,7 +40,7 @@ var (
 	layout_date             = "2006.01.02"
 	layout_date             = "2006.01.02"
 	orderStatus_unPaid      = 0                  //订单状态-待支付
 	orderStatus_unPaid      = 0                  //订单状态-待支付
 	orderStatus_paid        = 1                  //订单状态-已完成
 	orderStatus_paid        = 1                  //订单状态-已完成
-	orderStatus_deleted     = -1                 //订单状态-已删除
+	orderStatus_deleted     = 1                  //订单状态-已删除
 	orderStatus_cancel      = -2                 //订单状态-已取消
 	orderStatus_cancel      = -2                 //订单状态-已取消
 	tableName_order         = "dataexport_order" //订单表
 	tableName_order         = "dataexport_order" //订单表
 	order_pageSize          = 10
 	order_pageSize          = 10
@@ -112,7 +112,8 @@ func (o *OrderListDetails) MyOrder() {
 		return
 		return
 	}
 	}
 	queryM := map[string]interface{}{
 	queryM := map[string]interface{}{
-		"user_id": userId,
+		"user_id":    userId,
+		"del_status": 0, //默认未删除
 	}
 	}
 
 
 	typ := o.GetString("type") // 0全部 1未支付 2已支付
 	typ := o.GetString("type") // 0全部 1未支付 2已支付
@@ -126,8 +127,6 @@ func (o *OrderListDetails) MyOrder() {
 			status = orderStatus_cancel
 			status = orderStatus_cancel
 		}
 		}
 		queryM["order_status"] = status
 		queryM["order_status"] = status
-	} else {
-		queryM["order_status"] = map[string]interface{}{"ne": orderStatus_deleted}
 	}
 	}
 	fromPage := o.GetString("fromPage")
 	fromPage := o.GetString("fromPage")
 	if fromPage == "wx" { //微信暂无企业商机管理
 	if fromPage == "wx" { //微信暂无企业商机管理
@@ -161,8 +160,10 @@ func (o *OrderListDetails) DeleteOrder() error {
 			"id":      o.GetString("id"),
 			"id":      o.GetString("id"),
 			"user_id": userId.(string),
 			"user_id": userId.(string),
 		}
 		}
-		queryM := map[string]interface{}{}
-		queryM["user_id"] = userId
+		queryM := map[string]interface{}{
+			"user_id":    userId.(string),
+			"del_status": 0, //默认未删除
+		}
 		nextPage := false
 		nextPage := false
 		// 0全部 1未支付 2已支付
 		// 0全部 1未支付 2已支付
 		typ := o.GetString("type")
 		typ := o.GetString("type")
@@ -178,8 +179,6 @@ func (o *OrderListDetails) DeleteOrder() error {
 				status = orderStatus_cancel
 				status = orderStatus_cancel
 			}
 			}
 			queryM["order_status"] = status
 			queryM["order_status"] = status
-		} else {
-			queryM["order_status"] = map[string]interface{}{"ne": orderStatus_deleted}
 		}
 		}
 		if o.GetString("fromPage") != "" && o.GetString("fromPage") == "wx" { //微信暂无企业商机管理
 		if o.GetString("fromPage") != "" && o.GetString("fromPage") == "wx" { //微信暂无企业商机管理
 			queryM["product_type"] = map[string]interface{}{"ne": "企业商机管理"}
 			queryM["product_type"] = map[string]interface{}{"ne": "企业商机管理"}
@@ -209,8 +208,9 @@ func (o *OrderListDetails) DeleteOrder() error {
 				//取消订单
 				//取消订单
 				boo = util.Mysql.Update(tableName_order, queryMap, map[string]interface{}{"order_status": -2})
 				boo = util.Mysql.Update(tableName_order, queryMap, map[string]interface{}{"order_status": -2})
 			} else {
 			} else {
+				now := time.Now()
 				//删除订单
 				//删除订单
-				boo = util.Mysql.Update(tableName_order, queryMap, map[string]interface{}{"order_status": -1})
+				boo = util.Mysql.Update(tableName_order, queryMap, map[string]interface{}{"del_status": 1, "del_time": qutil.FormatDate(&now, qutil.Date_Full_Layout)})
 			}
 			}
 			if boo {
 			if boo {
 				util.MsgRemind.Delete(qutil.IntAll((*order)["id"]))
 				util.MsgRemind.Delete(qutil.IntAll((*order)["id"]))

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 2 - 2
src/web/staticres/wxCommonPay/css/weui.min.css


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio