yuliang1112 2 年之前
父节点
当前提交
48871419b7
共有 4 个文件被更改,包括 9 次插入7 次删除
  1. 4 3
      db/user.go
  2. 1 1
      route/init.go
  3. 2 2
      service/auto_task.go
  4. 2 1
      service/kuaiDi100.go

+ 4 - 3
db/user.go

@@ -344,8 +344,9 @@ func AccountInfo(ctx context.Context, pageSize, pageNum int32, conditions *commo
 
 func getPhoneByTalentID(ctx context.Context, talentID string) string {
 	db := GetReadDB(ctx)
-	talentInfo := gorm_model.YoungeeTalentInfo{}
-	err := db.Debug().Where("id = ?", talentID).First(&talentInfo).Error
+	//talentInfo := gorm_model.YoungeeTalentInfo{}
+	phoneNumber := ""
+	err := db.Debug().Model(&gorm_model.YoungeeTalentDeliveryAddress{}).Select("phone_number").Where("talent_id = ?", talentID).First(&phoneNumber).Error
 	if err != nil {
 		if err == gorm.ErrRecordNotFound {
 			return ""
@@ -353,7 +354,7 @@ func getPhoneByTalentID(ctx context.Context, talentID string) string {
 			return ""
 		}
 	}
-	return talentInfo.TalentPhoneNumber
+	return phoneNumber
 }
 
 func DeleteAccount(ctx context.Context, PlatformID, PlatformNickname, TalentId string) error {

+ 1 - 1
route/init.go

@@ -24,7 +24,7 @@ func InitRoute(r *gin.Engine) {
 	})
 	m := r.Group("/youngee/m")
 	{
-		//m.Use(middleware.LoginAuthMiddleware)
+		m.Use(middleware.LoginAuthMiddleware)
 		m.POST("/test", func(c *gin.Context) {
 			resp := http_model.CommonResponse{
 				Status:  0,

+ 2 - 2
service/auto_task.go

@@ -203,11 +203,11 @@ func AutoTask() error {
 		log.Println("GetAutoCaseCloseDefaultTask is running ,Time :", time.Now())
 	}
 	//定时任务
-	//spec := "*/30 * * * * ?" //cron表达式,每10秒一次
+	//spec := "*/30 * * * * ?" //cron表达式,每30秒一次
 	spec := "0 */1 * * * ?" //cron表达式,每一分钟执行一次
 	//spec := "0 0 * * * *" //每小时执行
 	// 添加定时任务,
-	_, err := crontab.AddFunc("@midnight", taskKDStatus)
+	_, err := crontab.AddFunc("0 0 * * * *", taskKDStatus)
 	//_, err := crontab.AddFunc("*/30 * * * * ?", taskKDStatus)
 	if err != nil {
 		return err

+ 2 - 1
service/kuaiDi100.go

@@ -50,7 +50,7 @@ var KD100Flags = map[string]string{
 
 // GetKDStatus 获取快递跟踪信息
 func GetKDStatus(com, num string) string {
-	fmt.Printf("查询物流公司为 %v, 快递为编号为 %v 的快递\n", KD100Flags[com], num)
+	fmt.Printf("查询物流公司为 %s, 快递为编号为 %v 的快递\n", KD100Flags[com], num)
 	key := "GsCwDkmq1520"                          //客户授权key
 	customer := "F2E05F275D02E5344011B3DCD6FEB80D" //查询公司编号
 
@@ -66,6 +66,7 @@ func GetKDStatus(com, num string) string {
 	sign := strings.ToUpper(GetMD5Encode(paramjson + key + customer))
 
 	// POST请求需要三个参数,分别为customer(CustomerId)和sign(签名)和param(参数)
+	fmt.Println("快递 sign:", sign)
 	postRes, postErr := http.PostForm(postUrl, url.Values{"customer": {customer}, "sign": {sign}, "param": {paramjson}})
 	if postErr != nil {
 		fmt.Println("查询失败" + postErr.Error())