Browse Source

Merge branch 'dev2.10.12' of http://192.168.3.207:10080/qmx/jy into dev2.10.12

wangshan 5 years ago
parent
commit
c468d82a6b

+ 0 - 1
src/jfw/modules/distribution/src/config.json

@@ -80,7 +80,6 @@
 		},
 		"flyerUserTime":"00:00"
     },
-    "uploadPath":"/uploadFile/",
     "catchoutTimesMonth":2,
     "authCost":1.2,
     "shareAutoInc":[

+ 2 - 2
src/jfw/modules/distribution/src/service/action/capital.go

@@ -71,12 +71,12 @@ func (l *Capital) List() {
 			}
 			if util.IntAll(v["count_status"]) == 2 {
 				if commission := util.Float64All(v["commission"]); commission > 0 {
-					cl.Money = fmt.Sprintf("%.2f", commission/100)
+					cl.Money = fmt.Sprintf("%.2f", commission/100)
 				}
 				cl.Status = "未结算"
 			} else {
 				if count_cash := util.Float64All(v["count_cash"]); count_cash > 0 {
-					cl.Money = fmt.Sprintf("%.2f", count_cash/100)
+					cl.Money = fmt.Sprintf("%.2f", count_cash/100)
 				}
 			}
 			if tax_cash := util.Float64All(v["tax_cash"]); tax_cash > 0 {

+ 14 - 46
src/jfw/modules/distribution/src/service/action/partner.go

@@ -48,9 +48,8 @@ func (p *Partner) SendMessage() {
 	}
 	status, msg := func() (int, string) {
 		token := p.GetString("token")
-		//TODO 测试时要取消注释
-		// phone := jy.CheckSendMsg(token)
-		if jy.IsPhone(token) && jy.SendPhoneIdentCode(token, p.Session()) {
+		phone := jy.CheckSendMsg(token)
+		if jy.IsPhone(phone) && jy.SendPhoneIdentCode(phone, p.Session()) {
 			return 1, ""
 		}
 		return -1, "发送失败"
@@ -93,8 +92,7 @@ func (p *Partner) AddPartner() {
 			return -1, "type参数格式错误"
 		}
 		channel := p.GetString("channel")
-		license := ""         //营业执照地址
-		fileDownFlag := false //备注:app客户端上传文件,文件上传至启明星后台,需要下载文件至本地
+		license := "" //营业执照地址
 		if typ == 2 {
 			if p.GetString("entname") == "" || p.GetString("license") == "" {
 				return -1, "缺少参数"
@@ -106,23 +104,8 @@ func (p *Partner) AddPartner() {
 			}
 			//如果是企业伙伴 直接进行认证
 			license = p.GetString("license")
-			ok, needDown := fileExistsCheck(license, 1)
-			if !ok {
-				return -1, "未找到上传文件"
-			}
-			if needDown && !fileDownFlag {
-				fileDownFlag = true
-			}
-			//文件类型校验
-			if fileDownFlag {
-				fileMsg := strings.Split(license, ".")
-				if len(fileMsg) < 2 {
-					return -1, "未知文件类型"
-				}
-				suffixName := fileMsg[len(fileMsg)-1]
-				if !checkType(suffixName, imgTypeArr) { //校验文件类型
-					return -1, "上传图片类型错误,支持类型" + strings.Join(imgTypeArr, "、")
-				}
+			if license == "" {
+				return -1, "未找到上传的图片"
 			}
 		}
 		//入库
@@ -160,7 +143,8 @@ func (p *Partner) AddPartner() {
 				"dis_commission": 0,
 				"dis_order":      0,
 			})
-			return insert_1 > 0 && insert_2 > 0 && insert_3 > 0
+			log.Println(insert_1, insert_2, insert_3)
+			return insert_1 > 0 && insert_2 > -1 && insert_3 > 0
 		}) {
 			return 1, ""
 		}
@@ -173,6 +157,7 @@ func (p *Partner) AddPartner() {
 	})
 }
 
+//暂未用到
 func (p *Partner) ImgUpload() {
 	if !R.CheckReqParam(p.ResponseWriter, p.Request, "type") {
 		return
@@ -235,12 +220,6 @@ func (p *Partner) PersonalAuth() {
 							 (legal_idcard=? or partner_id =?) and auth_status =?`, idNum, partner_id, 1) > 0 {
 			return -1, "该用户已认证"
 		}
-		//校验文件是否存在
-		for _, filePath := range []string{idCardZ, idCardF} {
-			if exists, _ := fileExistsCheck(filePath, 0); !exists {
-				return -1, "未找到上传文件"
-			}
-		}
 		return 1, ""
 	}()
 	if !Mysql.ExecTx("伙伴计划-个人认证", func(tx *sql.Tx) bool {
@@ -325,7 +304,8 @@ func (p *Partner) IsPartner() {
 func Getfilepath(suffixName string) (s string) {
 	var strs = time.Now().Format("20060102150405001")
 	var name = strs + qu.GetComplexRandom(8, 0, 0) + "." + suffixName
-	var path = "./web/staticres" + Sysconfig.UploadPath + "auth" + "/" + strs[:4] + "/" + strs[4:6] + "/" + strs[6:8] + "/"
+	//var path = "./web/staticres" + Sysconfig.UploadPath + "auth" + "/" + strs[:4] + "/" + strs[4:6] + "/" + strs[6:8] + "/"
+	var path = Sysconfig.UploadPath + "auth" + "/" + strs[:4] + "/" + strs[4:6] + "/" + strs[6:8] + "/"
 	os.MkdirAll(path, 0700)
 	return path + name
 }
@@ -365,14 +345,13 @@ func fileExistsCheck(filePath string, module int) (isExists bool, needDown bool)
 }
 
 //app客户端上传文件,文件上传至启明星后台,需要下载文件至本地;
-//并修改企业认证数据库
-func downLoadImgFileAndFlushDb(fileDate map[string]string, entName, phone, t string) {
+func downLoadImgFileAndFlushDb(fileDate map[string]string) {
 	update := map[string]interface{}{}
 	for k, url := range fileDate {
 		var err error
 		fileMsg := strings.Split(url, ".")
 		if len(fileMsg) < 2 {
-			log.Printf("%s %s图片后缀异常%s出错\n", entName, k, url)
+			log.Printf("%s %s图片后缀异常%s出错\n", k, url)
 			continue
 		}
 		suffixName := fileMsg[len(fileMsg)-1]
@@ -386,24 +365,13 @@ func downLoadImgFileAndFlushDb(fileDate map[string]string, entName, phone, t str
 		if err == nil {
 			update[k] = savePath
 		} else {
-			log.Printf("%s %s下载图片%s出错\n", entName, k, url)
+			log.Printf("%s %s下载图片%s出错\n", k, url)
 		}
 	}
 	if len(update) == 0 {
-		log.Printf("%s %+v无图片下载完成", entName, fileDate)
+		log.Printf("%s %+v无图片下载完成", fileDate)
 		return
 	}
-	//更新数据库
-	var ok bool
-	for i := 0; i < 3; i++ {
-		ok = Mysql.Update("entniche_info", map[string]interface{}{"name": entName, "phone": phone, "auth_time": t}, update)
-		if ok {
-			break
-		}
-	}
-	if !ok {
-		log.Printf("%s更新认证图片出错%+v =》 %+v\n", entName, fileDate, update)
-	}
 }
 
 //下载文件至本地