浏览代码

2.0版本final

Ohio-HYF 2 年之前
父节点
当前提交
4079ac66b9

+ 1 - 0
app/model/youngee_talent_model/project_detail.go

@@ -61,6 +61,7 @@ type ProjectDetail struct {
 	ProjectId        string             `json:"project_id"`                // 项目id
 	ProjectId        string             `json:"project_id"`                // 项目id
 	ProjectName      string             `json:"project_name"`              // 项目名称
 	ProjectName      string             `json:"project_name"`              // 项目名称
 	ProjectType      int                `json:"project_type"`              // 项目类型,1代表全流程项目,2代表专项项目
 	ProjectType      int                `json:"project_type"`              // 项目类型,1代表全流程项目,2代表专项项目
+	ProjectStatus    int                `json:"project_status"`            // 项目状态,1-10分别代表创建中、待审核、审核通过、招募中、招募完毕、待支付、已支付、失效、执行中、已结案
 	ProjectPlatform  int                `json:"project_platform"`          // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
 	ProjectPlatform  int                `json:"project_platform"`          // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
 	ProjectForm      int                `json:"project_form"`              // 项目形式,1-4分别代表实体商品寄拍、虚拟产品测评、线下探店打卡、素材微原创
 	ProjectForm      int                `json:"project_form"`              // 项目形式,1-4分别代表实体商品寄拍、虚拟产品测评、线下探店打卡、素材微原创
 	TalentType       string             `json:"talent_type"`               // 达人类型
 	TalentType       string             `json:"talent_type"`               // 达人类型

+ 2 - 1
app/service/youngee_talent_service/project_info.go

@@ -76,7 +76,8 @@ func GetProjectInfoList(r *ghttp.Request) *TalentHttpResult {
 
 
 	// 构造查询的条件
 	// 构造查询的条件
 	startId := pageIndex * cntPerPage
 	startId := pageIndex * cntPerPage
-	whereStr := fmt.Sprintf("(project_status >= %d and project_status <> %d and project_type = 1)", projectStatusRecruiting, projectStatusInvalid)
+	// whereStr := fmt.Sprintf("(project_status >= %d and project_status <> %d and project_type = 1)", projectStatusRecruiting, projectStatusInvalid)
+	whereStr := fmt.Sprintf("(project_status >= %d and fail_reason <> 2 and project_type = 1)", projectStatusRecruiting)
 	if platformList != nil {
 	if platformList != nil {
 		whereStr = whereStr + " and project_platform in ("
 		whereStr = whereStr + " and project_platform in ("
 		for _, v := range platformList {
 		for _, v := range platformList {

+ 28 - 11
app/service/youngee_talent_service/talent_address.go

@@ -3,6 +3,7 @@ package youngee_talent_service
 import (
 import (
 	"context"
 	"context"
 	"youngmini_server/app/dao"
 	"youngmini_server/app/dao"
+	"youngmini_server/app/model"
 	"youngmini_server/app/model/youngee_talent_model"
 	"youngmini_server/app/model/youngee_talent_model"
 	"youngmini_server/app/utils"
 	"youngmini_server/app/utils"
 
 
@@ -79,6 +80,15 @@ func OnAddTalentAddress(r *ghttp.Request) *TalentHttpResult {
 			return tErr
 			return tErr
 		}
 		}
 
 
+		// 如果当前无地址则将其设为默认地址
+		c, tErr := tx.Ctx(ctx).Model(dao.YoungeeTalentDeliveryAddress.Table).Where("talent_id", tid).Count()
+		if tErr != nil {
+			return tErr
+		}
+		if c == 0 {
+			tAddr.DefaultTag = 1
+		}
+
 		// 如果设置的是地址是默认地址,则把当前默认地址设为非默认
 		// 如果设置的是地址是默认地址,则把当前默认地址设为非默认
 		if tAddr.DefaultTag > 0 {
 		if tAddr.DefaultTag > 0 {
 			_, tErr = tx.Ctx(ctx).Model(dao.YoungeeTalentDeliveryAddress.Table).
 			_, tErr = tx.Ctx(ctx).Model(dao.YoungeeTalentDeliveryAddress.Table).
@@ -87,14 +97,12 @@ func OnAddTalentAddress(r *ghttp.Request) *TalentHttpResult {
 				return tErr
 				return tErr
 			}
 			}
 		}
 		}
-
-		// 如果当前无地址则将其设为默认地址
-		c, tErr := tx.Ctx(ctx).Model(dao.YoungeeTalentDeliveryAddress.Table).Where("talent_id", tid).Count()
-		if tErr != nil {
-			return tErr
-		}
-		if c == 0 {
-			tAddr.DefaultTag = 1
+		if tAddr.DefaultTag == 1 {
+			_, tErr = tx.Ctx(ctx).Model(dao.YoungeeTalentInfo.Table).
+				Update("talent_phone_number = ?", "id = ?", tAddr.PhoneNumber, tid)
+			if tErr != nil {
+				return tErr
+			}
 		}
 		}
 
 
 		// 将达人id存入结构体
 		// 将达人id存入结构体
@@ -104,7 +112,6 @@ func OnAddTalentAddress(r *ghttp.Request) *TalentHttpResult {
 		if tErr != nil {
 		if tErr != nil {
 			return tErr
 			return tErr
 		}
 		}
-
 		return nil
 		return nil
 	})
 	})
 
 
@@ -189,7 +196,7 @@ func SetDefaultDeliveryAddr(r *ghttp.Request) *TalentHttpResult {
 
 
 	aid := r.GetRequestInt32("address_id", 0)
 	aid := r.GetRequestInt32("address_id", 0)
 	if aid == 0 {
 	if aid == 0 {
-		return &TalentHttpResult{Code: -1, Msg: "address id error"}
+		return &TalentHttpResult{Code: -1, Msg: "Get address id error"}
 	}
 	}
 
 
 	rec, err := g.DB().Model(dao.YoungeeTalentDeliveryAddress.Table).One("talent_id = ? and default_tag = 1", tid)
 	rec, err := g.DB().Model(dao.YoungeeTalentDeliveryAddress.Table).One("talent_id = ? and default_tag = 1", tid)
@@ -214,10 +221,20 @@ func SetDefaultDeliveryAddr(r *ghttp.Request) *TalentHttpResult {
 			return nil
 			return nil
 		})
 		})
 	}
 	}
-
 	if err != nil {
 	if err != nil {
 		return &TalentHttpResult{Code: -3, Msg: "database error"}
 		return &TalentHttpResult{Code: -3, Msg: "database error"}
 	}
 	}
+	addressInfo := model.YoungeeTalentDeliveryAddress{}
+	err = g.DB().Model(dao.YoungeeTalentDeliveryAddress.Table).Where("address_id", aid).Scan(&addressInfo)
+	if err != nil {
+		return &TalentHttpResult{Code: -4, Msg: "address id error"}
+	}
+
+	_, err = g.DB().Model(dao.YoungeeTalentInfo.Table).
+		Update("talent_phone_number = ?", "id = ?", addressInfo.PhoneNumber, tid)
+	if err != nil {
+		return &TalentHttpResult{Code: -4, Msg: "address id error"}
+	}
 
 
 	return &TalentHttpResult{Code: 0, Msg: "success"}
 	return &TalentHttpResult{Code: 0, Msg: "success"}
 }
 }

二进制
bin/v10.0.0/linux_amd64/youngmini_server


二进制
bin/v10.0.0/windows_amd64/youngmini_server.exe


二进制
bin/v9.1.0/linux_amd64/youngmini_server


二进制
bin/v9.1.0/windows_amd64/youngmini_server.exe


+ 1 - 1
config/config.toml

@@ -19,7 +19,7 @@ name = "youngmini_server"
 output = "./bin"
 output = "./bin"
 pack = ""
 pack = ""
 system = "linux,windows"
 system = "linux,windows"
-version = "v7.0.9"
+version = "v10.0.0"
 [gfcli.gen.dao]
 [gfcli.gen.dao]
 jsonCase = "Snake"
 jsonCase = "Snake"
 link = "mysql:talent:talentDB_123@tcp(139.9.53.143:3306)/youngmini"
 link = "mysql:talent:talentDB_123@tcp(139.9.53.143:3306)/youngmini"