Browse Source

selection_bug_fix

Xingyu Xian 2 tuần trước cách đây
mục cha
commit
863494e11f
3 tập tin đã thay đổi với 11 bổ sung7 xóa
  1. 4 4
      db/sectask.go
  2. 5 3
      model/http_model/GetSecTaskList.go
  3. 2 0
      pack/sec_task_list.go

+ 4 - 4
db/sectask.go

@@ -30,7 +30,7 @@ func GetSecTaskById(ctx context.Context, secTaskId string) (*gorm_model.Younggee
 	return &secTaskInfo, nil
 }
 
-func GetSecTaskList(ctx context.Context, selectionId string, taskStatus int, searchValue string, saleNumMin int, saleNumMax int, pageSize, pageNum int64, orderBy []string, orderDesc []int) ([]*http_model.SecTaskInfo, int64, error) {
+func GetSecTaskList(ctx context.Context, selectionId string, taskStatus int, searchValue string, saleNumMin int, saleNumMax int, pageSize, pageNum int64, orderBy []string, orderDesc []string) ([]*http_model.SecTaskInfo, int64, error) {
 	db := GetReadDB(ctx)
 	// var taskStages []int
 	var freeStages []int
@@ -85,7 +85,7 @@ func GetSecTaskList(ctx context.Context, selectionId string, taskStatus int, sea
 	if len(orderBy) > 0 && len(orderDesc) > 0 && len(orderBy) == len(orderDesc) {
 		for i := 0; i < len(orderBy); i++ {
 			orderField := orderBy[i]
-			isDesc := orderDesc[i] == 1 // 1=降序,其他值=升序
+			isDesc := orderDesc[i] == "desc" // 1=降序,其他值=升序
 
 			switch orderField {
 			case "sale_num":
@@ -124,9 +124,9 @@ func GetSecTaskList(ctx context.Context, selectionId string, taskStatus int, sea
 		return nil, 0, err
 	}
 
-	fmt.Printf("secTaskInfoList:%+v", secTaskInfoList)
+	// fmt.Printf("secTaskInfoList:%+v", secTaskInfoList)
 	newSecTaskInfoList := pack.GormSecTaskListToHttpSecTaskList(secTaskInfoList)
-	fmt.Printf("newSecTaskInfoList:%+v", newSecTaskInfoList)
+	// fmt.Printf("newSecTaskInfoList:%+v", newSecTaskInfoList)
 
 	//for i, secTask := range newSecTaskInfoList {
 	//	if secTask.RegionCode != 0 {

+ 5 - 3
model/http_model/GetSecTaskList.go

@@ -4,7 +4,7 @@ import "time"
 
 type GetSecTaskListRequest struct {
 	PageSize      int64    `json:"page_size"`
-	PageNum       int64    `json:"page_num"`
+	PageNum       int64    `json:"page"`
 	SelectionId   string   `json:"selection_id"`
 	SecTaskStatus int      `json:"sec_task_status"`
 	SearchValue   string   `json:"search_value"`
@@ -14,8 +14,8 @@ type GetSecTaskListRequest struct {
 	RewardStage   int      `json:"reward_stage"`   // 悬赏阶段,1-2分别代表待结算(管理后台设置)、已结算(小程序端设置)
 	SaleNumMin    int      `json:"sale_num_min"`   // 30天橱窗销量区间最小值
 	SaleNumMax    int      `json:"sale_num_max"`   // 30天橱窗销量区间最大值
-	OrderBy       []string `json:"order_by"`       // 排序条件
-	OrderDesc     []int    `json:"order_desc"`     // 是否降序
+	OrderBy       []string `json:"sort_field"`     // 排序条件
+	OrderDesc     []string `json:"sort_order"`     // 是否降序
 }
 
 type GetSecTaskListData struct {
@@ -66,6 +66,8 @@ type SecTaskInfo struct {
 	ChooseTalentUserId     string    `json:"choose_talent_user_id"`     // 同意/拒绝达人操作人ID
 	ChooseTalentUserType   int       `json:"choose_talent_user_type"`   // 同意/拒绝达人操作人类型,1商家,2子账号
 	ChooseTalentUserName   string    `json:"choose_talent_user_name"`   // 同意/拒绝达人操作人名称
+	TalentOrigin           string    `json:"talent_origin"`             // 达人来源,"公海"
+	SupplierType           int       `json:"supplier_type"`             // 服务商类型,0达人来自公海,1为个人服务商,2为企业服务商
 }
 
 func NewGetSecTaskListRequest() *GetSecTaskListRequest {

+ 2 - 0
pack/sec_task_list.go

@@ -47,6 +47,8 @@ func GormSecTaskToHttpSecTask(secTask *gorm_model.YounggeeSecTaskInfo) *http_mod
 		ChooseTalentUserId:     secTask.ChooseTalentUserId,
 		ChooseTalentUserType:   secTask.ChooseTalentUserType,
 		ChooseTalentUserName:   secTask.ChooseTalentUserId,
+		SupplierType:           0,
+		TalentOrigin:           "公海",
 	}
 }