Răsfoiți Sursa

wip:业绩生效,同步订单表

wangkaiyue 9 luni în urmă
părinte
comite
04635ed237

+ 9 - 3
src/jfw/modules/subscribepay/src/entity/payCommonEntity.go

@@ -34,8 +34,8 @@ func TakeEffectSale(orderCode string, payMoney int) {
 				"change_reason":   "回款成功",
 				"create_time":     FormatDate(&now, "2006-01-02 15:04:05"),
 				"statistics_time": FormatDate(&now, "2006-01-02 15:04:05"),
-			}) > 0 {
-				return true
+			}) <= 0 {
+				return false
 			}
 		} else {
 			if gconv.Int((*res)["state"]) == 2 {
@@ -55,7 +55,13 @@ func TakeEffectSale(orderCode string, payMoney int) {
 			}
 			return true
 		}
-		return false
+		//订单表业绩字段更新,与销售业绩表保持一致
+		if !util.Mysql.Update("dataexport_order", map[string]interface{}{
+			"order_code": orderCode,
+		}, map[string]interface{}{"sale_time": FormatDate(&now, "2006-01-02 15:04:05")}) {
+			return false
+		}
+		return true
 	}) {
 		log.Printf("%s 销售业绩生效异常", orderCode)
 	}