Yankun168 10 miesięcy temu
rodzic
commit
e19cb57c73

+ 1 - 1
.idea/JavaSceneConfigState.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="SmartInputSourceJavaSceneConfigState">
-    <option name="customChineseScenes" value="{&quot;capsLockState&quot;:false,&quot;code&quot;:&quot;;Printf(format);Println(a);TalentHttpResult(Msg);panic(v)&quot;,&quot;enable&quot;:true,&quot;languageType&quot;:&quot;CHINESE&quot;,&quot;name&quot;:&quot;自定义中文切换&quot;,&quot;tip&quot;:&quot;&quot;}" />
+    <option name="customChineseScenes" value="{&quot;capsLockState&quot;:false,&quot;code&quot;:&quot;;Printf(format);Println(a);TalentHttpResult(Msg);panic(v);ListSecTaskTabRes(Msg)&quot;,&quot;enable&quot;:true,&quot;languageType&quot;:&quot;CHINESE&quot;,&quot;name&quot;:&quot;自定义中文切换&quot;,&quot;tip&quot;:&quot;&quot;}" />
   </component>
 </project>

+ 1 - 0
app/model/model.go

@@ -1310,6 +1310,7 @@ type YounggeeSelectionInfo struct {
 	IsRead           int         `orm:"is_read"              json:"is_read"`            // 是否已读
 	AutoTaskId       int         `orm:"auto_task_id"         json:"auto_task_id"`       // 定时任务id
 	AutoFailAt       *gtime.Time `orm:"auto_fail_at"         json:"auto_fail_at"`       // 失效自动处理时间
+
 }
 
 // YounggeeSketchInfo is the golang structure for table younggee_sketch_info.

+ 83 - 63
app/model/youngee_talent_model/selection_task.go

@@ -2,6 +2,7 @@ package youngee_talent_model
 
 import (
 	"github.com/gogf/gf/os/gtime"
+	"github.com/gogf/gf/util/gmeta"
 	"youngmini_server/app/model"
 )
 
@@ -20,80 +21,99 @@ type SignSecTaskResp struct {
 }
 
 type SecTaskInfoDetail struct {
-	Id                     int              `orm:"id,primary"                json:"id"`           // 递增id
-	TaskId                 string           `orm:"task_id"                   json:"task_id"`      // 选品任务id
-	SelectionId            string           `orm:"selection_id"              json:"selection_id"` // 选品id
-	ProductId              int              `orm:"product_id"                json:"product_id"`
-	TalentId               string           `orm:"talent_id"                 json:"talent_id"`                 // 达人id
-	AccountId              int              `orm:"account_id"                json:"account_id"`                // 账号id
-	TalentPlatformInfoSnap string           `orm:"talent_platform_info_snap" json:"talent_platform_info_snap"` // 达人平台信息快照
-	TalentPersonalInfoSnap string           `orm:"talent_personal_info_snap" json:"talent_personal_info_snap"` // 达人个人信息快照
-	TalentPostAddrSnap     string           `orm:"talent_post_addr_snap"     json:"talent_post_addr_snap"`     // 收货地址快照
-	TaskReward             float64          `orm:"task_reward"               json:"task_reward"`               // 达人赏金
-	TalentPayment          float64          `orm:"talent_payment"            json:"talent_payment"`            // 达人垫付金额
-	IsPayPayment           int              `orm:"is_pay_payment"            json:"is_pay_payment"`            // 企业是否返样品钱
-	IsPayReward            int              `orm:"is_pay_reward"             json:"is_pay_reward"`             // 企业是否结算悬赏
-	TaskMode               int              `orm:"task_mode"                 json:"task_mode"`                 // 任务形式,1、2分别表示悬赏任务、纯佣带货',
-	SampleMode             int              `orm:"sample_mode"               json:"sample_mode"`               // 领样形式,1-3分别表示免费领样、垫付买样、不提供样品
-	TaskStatus             int              `orm:"task_status"               json:"task_status"`               // 任务状态 1待选 2已选 3落选
-	TaskStage              int              `orm:"task_stage"                json:"task_stage"`                // 任务阶段,详情见info_sec_task_stage表
-	CreateDate             *gtime.Time      `orm:"create_date"               json:"create_date"`               // 创建时间
-	SelectDate             *gtime.Time      `orm:"select_date"               json:"select_date"`               // 反选时间
-	DeliveryDate           *gtime.Time      `orm:"delivery_date"             json:"delivery_date"`             // 发货时间
-	CompleteDate           *gtime.Time      `orm:"complete_date"             json:"complete_date"`             // 结束时间
-	WithdrawDate           *gtime.Time      `orm:"withdraw_date"             json:"withdraw_date"`             // 提现时间
-	CompleteStatus         int              `orm:"complete_status"           json:"complete_status"`           // 结束方式 1未结束 2正常结束 3反选失败
-	LogisticsStatus        int              `orm:"logistics_status"          json:"logistics_status"`          // 发货状态 1 待发货 2已发货 3 已签收
-	AssignmentStatus       uint             `orm:"assignment_status"         json:"assignment_status"`         // 作业上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
-	UpdateAt               *gtime.Time      `orm:"update_at"                 json:"update_at"`                 // 更新时间
-	WithdrawStatus         int              `orm:"withdraw_status"           json:"withdraw_status"`           // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现
-	LeadTeamId             string           `orm:"lead_team_id"              json:"lead_team_id"`              // 作为团长的young之团id,对应younggee_talent_team中的team_id字段
-	TeamId                 string           `orm:"team_id"                   json:"team_id"`                   // 作为团员的young之团id,对应younggee_talent_team中的team_id字段
-	TeamIncome             int              `orm:"team_income"               json:"team_income"`               // young之团团长现金收益
-	TeamPoint              int              `orm:"team_point"                json:"team_point"`                // young之团团长积分收益
-	SelectionDetail        *SelectionDetail //含选品所有信息
-	FansNum                int              `orm:"fans_num"                json:"fans_num"`         // 粉丝数
-	SaleNum                int              `orm:"sale_num"                json:"sale_num"`         // 粉丝数
-	FreeStage              int              `orm:"free_stage"                json:"free_stage"`     // 免费领样阶段,1-5分别代表已申请、已拒绝、待发货、已发货、已收货',
-	RewardStage            int              `orm:"reward_stage"                json:"reward_stage"` //悬赏阶段,1-2分别代表待结算、已结算',
-	SaleNumAll             int              `orm:"sale_num_all"                json:"sale_num_all"` //达人对此商品的全部销售量(大于1表示已出单)
+	gmeta.Meta             `orm:"table:younggee_sec_task_info"`
+	Id                     int                          `orm:"id,primary"                json:"id"`           // 递增id
+	TaskId                 string                       `orm:"task_id"                   json:"task_id"`      // 选品任务id
+	SelectionId            string                       `orm:"selection_id"              json:"selection_id"` // 选品id
+	ProductId              int                          `orm:"product_id"                json:"product_id"`
+	TalentId               string                       `orm:"talent_id"                 json:"talent_id"`                 // 达人id
+	AccountId              int                          `orm:"account_id"                json:"account_id"`                // 账号id
+	PlatformId             int                          `orm:"platform_id"                json:"platform_id"`              // 平台id
+	TalentPlatformInfoSnap string                       `orm:"talent_platform_info_snap" json:"talent_platform_info_snap"` // 达人平台信息快照
+	TalentPersonalInfoSnap string                       `orm:"talent_personal_info_snap" json:"talent_personal_info_snap"` // 达人个人信息快照
+	TalentPostAddrSnap     string                       `orm:"talent_post_addr_snap"     json:"talent_post_addr_snap"`     // 收货地址快照
+	TaskReward             float64                      `orm:"task_reward"               json:"task_reward"`               // 达人赏金
+	TalentPayment          float64                      `orm:"talent_payment"            json:"talent_payment"`            // 达人垫付金额
+	IsPayPayment           int                          `orm:"is_pay_payment"            json:"is_pay_payment"`            // 企业是否返样品钱
+	IsPayReward            int                          `orm:"is_pay_reward"             json:"is_pay_reward"`             // 企业是否结算悬赏
+	TaskMode               int                          `orm:"task_mode"                 json:"task_mode"`                 // 任务形式,1、2分别表示悬赏任务、纯佣带货',
+	SampleMode             int                          `orm:"sample_mode"               json:"sample_mode"`               // 领样形式,1-3分别表示免费领样、垫付买样、不提供样品
+	TaskStatus             int                          `orm:"task_status"               json:"task_status"`               // 任务状态 1待选 2已选 3落选
+	TaskStage              int                          `orm:"task_stage"                json:"task_stage"`                // 任务阶段,详情见info_sec_task_stage表
+	CreateDate             *gtime.Time                  `orm:"create_date"               json:"create_date"`               // 创建时间
+	SelectDate             *gtime.Time                  `orm:"select_date"               json:"select_date"`               // 反选时间
+	DeliveryDate           *gtime.Time                  `orm:"delivery_date"             json:"delivery_date"`             // 发货时间
+	CompleteDate           *gtime.Time                  `orm:"complete_date"             json:"complete_date"`             // 结束时间
+	WithdrawDate           *gtime.Time                  `orm:"withdraw_date"             json:"withdraw_date"`             // 提现时间
+	CompleteStatus         int                          `orm:"complete_status"           json:"complete_status"`           // 结束方式 1未结束 2正常结束 3反选失败
+	LogisticsStatus        int                          `orm:"logistics_status"          json:"logistics_status"`          // 发货状态 1 待发货 2已发货 3 已签收
+	AssignmentStatus       uint                         `orm:"assignment_status"         json:"assignment_status"`         // 作业上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	UpdateAt               *gtime.Time                  `orm:"update_at"                 json:"update_at"`                 // 更新时间
+	WithdrawStatus         int                          `orm:"withdraw_status"           json:"withdraw_status"`           // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现
+	LeadTeamId             string                       `orm:"lead_team_id"              json:"lead_team_id"`              // 作为团长的young之团id,对应younggee_talent_team中的team_id字段
+	TeamId                 string                       `orm:"team_id"                   json:"team_id"`                   // 作为团员的young之团id,对应younggee_talent_team中的team_id字段
+	TeamIncome             int                          `orm:"team_income"               json:"team_income"`               // young之团团长现金收益
+	TeamPoint              int                          `orm:"team_point"                json:"team_point"`                // young之团团长积分收益
+	FansNum                int                          `orm:"fans_num"                json:"fans_num"`                    // 粉丝数
+	SaleNum                int                          `orm:"sale_num"                json:"sale_num"`                    // 30天橱窗销量
+	FreeStage              int                          `orm:"free_stage"                json:"free_stage"`                // 免费领样阶段,1-5分别代表已申请、已拒绝、待发货、已发货、已收货',
+	RewardStage            int                          `orm:"reward_stage"                json:"reward_stage"`            //悬赏阶段,1-2分别代表待结算、已结算',
+	SaleActual             int                          `orm:"sale_actual"                json:"sale_actual"`
+	SaleNumAll             int                          `orm:"sale_num_all"                json:"sale_num_all"` //达人对此商品的全部销售量(大于1表示已出单)
+	RewardStrategy         []*RewardStrategy            `orm:"with:selection_id=selection_id"`                  // 悬赏策略表
+	SelectionInfo          *model.YounggeeSelectionInfo `orm:"with:selection_id=selection_id"`                  //选品表
+	YounggeeProduct        *YounggeeProduct             `orm:"with:product_id=product_id"`                      // 商品基本表
+	YounggeeProductPhoto   []*YounggeeProductPhoto      `orm:"with:product_id=product_id"`                      // 商品图片表
+	PlatformInfo           *PlatformInfo                `orm:"with:platform_id=platform_id"`
+	TaskDdl                *gtime.Time                  `json:"task_ddl"`
 }
 
 type SecTaskInfoWindowDetail struct {
+	gmeta.Meta             `orm:"table:younggee_sec_task_info"`
 	Id                     int    `orm:"id,primary"                json:"id"`           // 递增id
 	TaskId                 string `orm:"task_id"                   json:"task_id"`      // 选品任务id
 	SelectionId            string `orm:"selection_id"              json:"selection_id"` // 选品id
 	ProductId              int    `orm:"product_id"                json:"product_id"`
 	TalentId               string `orm:"talent_id"                 json:"talent_id"`                 // 达人id
 	AccountId              int    `orm:"account_id"                json:"account_id"`                // 账号id
+	PlatformId             int    `orm:"platform_id"                json:"platform_id"`              // 平台id
 	TalentPlatformInfoSnap string `orm:"talent_platform_info_snap" json:"talent_platform_info_snap"` // 达人平台信息快照
 	TalentPersonalInfoSnap string `orm:"talent_personal_info_snap" json:"talent_personal_info_snap"` // 达人个人信息快照
-	//TalentPostAddrSnap     string           `orm:"talent_post_addr_snap"     json:"talent_post_addr_snap"`     // 收货地址快照
-	TaskReward       float64          `orm:"task_reward"               json:"task_reward"`       // 达人赏金
-	TalentPayment    float64          `orm:"talent_payment"            json:"talent_payment"`    // 达人垫付金额
-	IsPayPayment     int              `orm:"is_pay_payment"            json:"is_pay_payment"`    // 企业是否返样品钱
-	IsPayReward      int              `orm:"is_pay_reward"             json:"is_pay_reward"`     // 企业是否结算悬赏
-	TaskMode         int              `orm:"task_mode"                 json:"task_mode"`         // 任务形式,1、2分别表示纯佣带货、悬赏任务
-	SampleMode       int              `orm:"sample_mode"               json:"sample_mode"`       // 领样形式,1-3分别表示免费领样、垫付买样、不提供样品
-	TaskStatus       int              `orm:"task_status"               json:"task_status"`       // 任务状态 1待选 2已选 3落选
-	TaskStage        int              `orm:"task_stage"                json:"task_stage"`        // 任务阶段,详情见info_sec_task_stage表
-	CreateDate       *gtime.Time      `orm:"create_date"               json:"create_date"`       // 创建时间
-	SelectDate       *gtime.Time      `orm:"select_date"               json:"select_date"`       // 反选时间
-	DeliveryDate     *gtime.Time      `orm:"delivery_date"             json:"delivery_date"`     // 发货时间
-	CompleteDate     *gtime.Time      `orm:"complete_date"             json:"complete_date"`     // 结束时间
-	WithdrawDate     *gtime.Time      `orm:"withdraw_date"             json:"withdraw_date"`     // 提现时间
-	CompleteStatus   int              `orm:"complete_status"           json:"complete_status"`   // 结束方式 1未结束 2正常结束 3反选失败
-	LogisticsStatus  int              `orm:"logistics_status"          json:"logistics_status"`  // 发货状态 1 待发货 2已发货 3 已签收
-	AssignmentStatus uint             `orm:"assignment_status"         json:"assignment_status"` // 作业上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
-	UpdateAt         *gtime.Time      `orm:"update_at"                 json:"update_at"`         // 更新时间
-	WithdrawStatus   int              `orm:"withdraw_status"           json:"withdraw_status"`   // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现
-	LeadTeamId       string           `orm:"lead_team_id"              json:"lead_team_id"`      // 作为团长的young之团id,对应younggee_talent_team中的team_id字段
-	TeamId           string           `orm:"team_id"                   json:"team_id"`           // 作为团员的young之团id,对应younggee_talent_team中的team_id字段
-	TeamIncome       int              `orm:"team_income"               json:"team_income"`       // young之团团长现金收益
-	TeamPoint        int              `orm:"team_point"                json:"team_point"`        // young之团团长积分收益
-	SelectionDetail  *SelectionDetail //含选品所有信息
-	FansNum          int              `orm:"fans_num"                json:"fans_num"` // 粉丝数
-	SaleNum          int              `orm:"sale_num"                json:"sale_num"` // 粉丝数
+	//TalentPostAddrSnap     string                       `orm:"talent_post_addr_snap"     json:"talent_post_addr_snap"`     // 收货地址快照     加入橱窗不需要收获地址
+	TaskReward           float64                      `orm:"task_reward"               json:"task_reward"`       // 达人赏金
+	TalentPayment        float64                      `orm:"talent_payment"            json:"talent_payment"`    // 达人垫付金额
+	IsPayPayment         int                          `orm:"is_pay_payment"            json:"is_pay_payment"`    // 企业是否返样品钱
+	IsPayReward          int                          `orm:"is_pay_reward"             json:"is_pay_reward"`     // 企业是否结算悬赏
+	TaskMode             int                          `orm:"task_mode"                 json:"task_mode"`         // 任务形式,1、2分别表示悬赏任务、纯佣带货',
+	SampleMode           int                          `orm:"sample_mode"               json:"sample_mode"`       // 领样形式,1-3分别表示免费领样、垫付买样、不提供样品
+	TaskStatus           int                          `orm:"task_status"               json:"task_status"`       // 任务状态 1待选 2已选 3落选
+	TaskStage            int                          `orm:"task_stage"                json:"task_stage"`        // 任务阶段,详情见info_sec_task_stage表
+	CreateDate           *gtime.Time                  `orm:"create_date"               json:"create_date"`       // 创建时间
+	SelectDate           *gtime.Time                  `orm:"select_date"               json:"select_date"`       // 反选时间
+	DeliveryDate         *gtime.Time                  `orm:"delivery_date"             json:"delivery_date"`     // 发货时间
+	CompleteDate         *gtime.Time                  `orm:"complete_date"             json:"complete_date"`     // 结束时间
+	WithdrawDate         *gtime.Time                  `orm:"withdraw_date"             json:"withdraw_date"`     // 提现时间
+	CompleteStatus       int                          `orm:"complete_status"           json:"complete_status"`   // 结束方式 1未结束 2正常结束 3反选失败
+	LogisticsStatus      int                          `orm:"logistics_status"          json:"logistics_status"`  // 发货状态 1 待发货 2已发货 3 已签收
+	AssignmentStatus     uint                         `orm:"assignment_status"         json:"assignment_status"` // 作业上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	UpdateAt             *gtime.Time                  `orm:"update_at"                 json:"update_at"`         // 更新时间
+	WithdrawStatus       int                          `orm:"withdraw_status"           json:"withdraw_status"`   // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现
+	LeadTeamId           string                       `orm:"lead_team_id"              json:"lead_team_id"`      // 作为团长的young之团id,对应younggee_talent_team中的team_id字段
+	TeamId               string                       `orm:"team_id"                   json:"team_id"`           // 作为团员的young之团id,对应younggee_talent_team中的team_id字段
+	TeamIncome           int                          `orm:"team_income"               json:"team_income"`       // young之团团长现金收益
+	TeamPoint            int                          `orm:"team_point"                json:"team_point"`        // young之团团长积分收益
+	FansNum              int                          `orm:"fans_num"                json:"fans_num"`            // 粉丝数
+	SaleNum              int                          `orm:"sale_num"                json:"sale_num"`            // 30天橱窗销量
+	FreeStage            int                          `orm:"free_stage"                json:"free_stage"`        // 免费领样阶段,1-5分别代表已申请、已拒绝、待发货、已发货、已收货',
+	RewardStage          int                          `orm:"reward_stage"                json:"reward_stage"`    //悬赏阶段,1-2分别代表待结算、已结算',
+	SaleActual           int                          `orm:"sale_actual"                json:"sale_actual"`
+	SaleNumAll           int                          `orm:"sale_num_all"                json:"sale_num_all"` //达人对此商品的全部销售量(大于1表示已出单)
+	RewardStrategy       []*RewardStrategy            `orm:"with:selection_id=selection_id"`                  // 悬赏策略表
+	SelectionInfo        *model.YounggeeSelectionInfo `orm:"with:selection_id=selection_id"`                  //选品表
+	YounggeeProduct      *YounggeeProduct             `orm:"with:product_id=product_id"`                      // 商品基本表
+	YounggeeProductPhoto []*YounggeeProductPhoto      `orm:"with:product_id=product_id"`                      // 商品图片表
+	PlatformInfo         *PlatformInfo                `orm:"with:platform_id=platform_id"`
+	TaskDdl              *gtime.Time                  `json:"task_ddl"`
 }
 
 type SecTaskInfoBrief struct {

+ 10 - 10
app/model/youngee_talent_model/talent_info.go

@@ -47,14 +47,14 @@ type TalentInfo struct {
 }
 
 type TalentInfoNum struct {
-	AllTaskNum      int `json:"all_task_num"`
-	ApplyTaskNum    int `json:"apply_task_num"`
-	ExeTaskNum      int `json:"exe_task_num"`
-	EndTaskNum      int `json:"end_task_num"`
-	ExeTeamNum      int `json:"exe_team_num"`
-	EndTeamNum      int `json:"end_team_num"`
-	AllSecTaskNum   int `json:"all_sec_task_num"`
-	ApplySecTaskNum int `json:"apply_sec_task_num"`
-	ExeSecTaskNum   int `json:"exe_sec_task_num"`
-	EndSecTaskNum   int `json:"end_sec_task_num"`
+	AllTaskNum          int `json:"all_task_num"`
+	ApplyTaskNum        int `json:"apply_task_num"`
+	ExeTaskNum          int `json:"exe_task_num"`
+	EndTaskNum          int `json:"end_task_num"`
+	ExeTeamNum          int `json:"exe_team_num"`
+	EndTeamNum          int `json:"end_team_num"`
+	AllSecTaskNum       int `json:"all_sec_task_num"`        //所有带货
+	GetSampleSecTaskNum int `json:"get_sample_sec_task_num"` //已领样
+	ExeSecTaskNum       int `json:"exe_sec_task_num"`        //已出单
+	EndSecTaskNum       int `json:"end_sec_task_num"`        //已结束
 }

+ 18 - 8
app/service/youngee_sectask_service/seletion_square.go

@@ -280,6 +280,10 @@ func SignUpSecTask(r *ghttp.Request) *TalentHttpResult {
 		return &TalentHttpResult{Code: -3, Msg: err.Error()}
 	}
 
+	//获取选品表中的ddl
+	var selectionInfo *model.YounggeeSelectionInfo
+	err = g.DB().Model("younggee_selection_info").Where("selection_id", signSecTaskReq.SelectionId).Scan(&selectionInfo)
+
 	var product model.YounggeeProduct
 	err = json.Unmarshal([]byte(selectionDetail.ProductSnap), &product)
 	if err != nil {
@@ -346,6 +350,7 @@ func SignUpSecTask(r *ghttp.Request) *TalentHttpResult {
 		TaskMode:               selectionDetail.TaskMode,
 		SampleMode:             selectionDetail.SampleMode,
 		FreeStage:              1, //领样状态:已申请    悬赏状态默认为0
+		PlatformId:             4, //快手平台
 		TaskStage:              3,
 		TaskStatus:             1,
 		CreateDate:             gtime.Now(),
@@ -358,7 +363,7 @@ func SignUpSecTask(r *ghttp.Request) *TalentHttpResult {
 		TeamId:                 signSecTaskReq.TeamId,
 		TeamIncome:             0,
 		TeamPoint:              0,
-		SelectionDetail:        selectionDetail,
+		TaskDdl:                selectionInfo.TaskDdl,
 	}
 
 	//删除添加橱窗时创建的不完整的数据
@@ -493,6 +498,11 @@ func SignUpSecTaskFromWindow(r *ghttp.Request) *TalentHttpResult {
 	if err != nil {
 		return &TalentHttpResult{Code: -3, Msg: err.Error()}
 	}
+
+	//获取选品表中的ddl
+	var selectionInfo *model.YounggeeSelectionInfo
+	err = g.DB().Model("younggee_selection_info").Where("selection_id", signSecTaskReq.SelectionId).Scan(&selectionInfo)
+
 	var product model.YounggeeProduct
 	err = json.Unmarshal([]byte(selectionDetail.ProductSnap), &product)
 	if err != nil {
@@ -534,13 +544,13 @@ func SignUpSecTaskFromWindow(r *ghttp.Request) *TalentHttpResult {
 		TalentPlatformInfoSnap: string(accountSnap),
 		TalentPersonalInfoSnap: string(talentSnap),
 		//TalentPostAddrSnap:     string(addrSnap),
-		TaskReward:    selectionDetail.TaskReward,
-		TalentPayment: product.ProductPrice,
-		IsPayPayment:  0,
-		IsPayReward:   0,
-		TaskMode:      selectionDetail.TaskMode,
-		//SampleMode:       selectionDetail.SampleMode,
+		TaskReward:       selectionInfo.TaskReward,
+		TalentPayment:    product.ProductPrice,
+		IsPayPayment:     0,
+		IsPayReward:      0,
+		TaskMode:         selectionInfo.TaskMode,
 		SampleMode:       3, //添加橱窗,当作不提供领样处理
+		PlatformId:       4, //快手平台
 		TaskStage:        3,
 		TaskStatus:       1,
 		CreateDate:       gtime.Now(),
@@ -553,7 +563,7 @@ func SignUpSecTaskFromWindow(r *ghttp.Request) *TalentHttpResult {
 		TeamId:           signSecTaskReq.TeamId,
 		TeamIncome:       0,
 		TeamPoint:        0,
-		SelectionDetail:  selectionDetail,
+		TaskDdl:          selectionInfo.TaskDdl,
 	}
 	//如果已经有数据了,删除。模拟在快手侧里把橱窗商品删了,想再加回来
 	//删除添加橱窗时创建的不完整的数据

+ 4 - 7
app/service/youngee_talent_service/talent_info.go

@@ -102,22 +102,19 @@ func GetMyInfoNum(r *ghttp.Request) *TalentHttpResult {
 	}
 
 	// 查询选品任务相关数量
-	var signSecTaskStageList = []int{2, 3}
-	var exeSecTaskStageList = []int{6, 7, 8}
-	var endSecTaskStageList = []int{5, 9, 10}
-	talentInfoNum.AllSecTaskNum, err = g.DB().Model(dao.YounggeeSecTaskInfo.Table).Where("talent_id = ?", tid).Count()
+	talentInfoNum.AllSecTaskNum, err = g.DB().Model(youngee_talent_model.SecTaskInfoDetail{}).Where("talent_id = ?", tid).Count()
 	if err != nil {
 		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
 	}
-	talentInfoNum.ApplySecTaskNum, err = g.DB().Model(dao.YounggeeSecTaskInfo.Table).Where("talent_id = ? and task_stage in (?)", tid, signSecTaskStageList).Count()
+	talentInfoNum.GetSampleSecTaskNum, err = g.DB().Model(dao.YounggeeSecTaskInfo.Table).Where("talent_id = ? and free_stage in (3,4, 5)", tid).Count()
 	if err != nil {
 		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
 	}
-	talentInfoNum.ExeSecTaskNum, err = g.DB().Model(dao.YounggeeSecTaskInfo.Table).Where("talent_id = ? and task_stage in (?)", tid, exeSecTaskStageList).Count()
+	talentInfoNum.ExeSecTaskNum, err = g.DB().Model(dao.YounggeeSecTaskInfo.Table).Where("talent_id = ? and sale_num_all > 0", tid).Count()
 	if err != nil {
 		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
 	}
-	talentInfoNum.EndSecTaskNum, err = g.DB().Model(dao.YounggeeSecTaskInfo.Table).Where("talent_id = ? and task_stage in (?) ", tid, endSecTaskStageList).Count()
+	talentInfoNum.EndSecTaskNum, err = g.DB().Model(dao.YounggeeSecTaskInfo.Table).Where("talent_id = ? and task_ddl < NOW() ", tid).Count()
 	if err != nil {
 		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
 	}

+ 3 - 3
app/system/assignment/assignment_service.go

@@ -28,11 +28,11 @@ func (s *assignmentService) Add(r *ghttp.Request, req *AddAssignmentReq) (res sq
 		return nil, err
 	}
 
-	// 2. 更新任务阶段   上传截图,任务状态变成待结算9   作业上传状态变成2(已添加)
+	// 2. 更新任务阶段   上传截图,
 	updateStageReq := sectask.UpdateStageReq{
 		TaskId:           req.TaskId,
-		TaskStage:        9,
-		AssignmentStatus: 2,
+		TaskStage:        9, //任务状态变成待结算9
+		AssignmentStatus: 2, //作业上传状态变成2(已添加)
 	}
 	err = sectask.UpdateStageAndStatus(r.Context(), &updateStageReq)
 	if err != nil {

+ 13 - 1
app/system/sectask/sectask_api.go

@@ -18,13 +18,25 @@ func (*secTaskApi) List(r *ghttp.Request) {
 	if err != nil {
 		response.Code(r, err)
 	}
-	if res, err := service.List(r.Context(), &req, tid); err != nil {
+	res, err := service.List(r.Context(), &req, tid)
+	if err != nil {
 		response.Code(r, err)
 	} else {
 		response.SuccessWithData(r, res)
 	}
 }
 
+func (*secTaskApi) ListTab(r *ghttp.Request) {
+	var req ListSecTaskTabReq
+	req.TabStage, _ = strconv.Atoi(r.Get("tab_stage").(string))
+	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
+	if err != nil {
+		response.Code(r, err)
+	}
+	res := service.ListTab(&req, tid)
+	response.SuccessWithData(r, res)
+}
+
 func (*secTaskApi) ShowLogisticsDetail(r *ghttp.Request) {
 	var taskId = r.Get("task_id").(string)
 	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)

+ 23 - 1
app/system/sectask/sectask_model.go

@@ -10,12 +10,35 @@ type ListSecTaskReq struct {
 	TaskStage int `json:"task_stage"`
 }
 
+type ListSecTaskTabReq struct {
+	TabStage int `json:"tab_stage"`
+}
+
 type ListSecTaskRes struct {
 	Count   int               `json:"count"`    //任务列表有几个
 	SecTask []*ListSecTaskSql `json:"sec_task"` //这几个对应的sectask信息
 	//SelectionDetail []*youngee_talent_model.SelectionDetail //可动态改变的详细的selectiondetail
 }
 
+type ListSecTaskTabRes struct {
+	Msg          string                                   `json:"msg"`
+	Count        int                                      `json:"count"` //任务列表有几个
+	SecTaskTable []youngee_talent_model.SecTaskInfoDetail //这几个对应的sectask信息
+}
+
+type ListSecTaskTabSql struct {
+	TaskId               string                                       `json:"task_id"`                       // 选品任务id
+	SelectionId          string                                       `json:"selection_id"`                  // 选品id
+	ProductId            int                                          `json:"product_id"`                    // 商品id
+	TalentId             string                                       `json:"talent_id"`                     // 达人id
+	RewardStrategy       []*youngee_talent_model.RewardStrategy       `orm:"with:selection_id=selection_id"` // 悬赏策略表
+	SecTaskTable         *youngee_talent_model.SecTaskInfoDetail      `orm:"with:task_id=task_id"`
+	ProductPhotoSnap     string                                       `json:"product_photo_snap"`
+	YounggeeProductPhoto []*youngee_talent_model.YounggeeProductPhoto // 商品图片表
+	TaskDdl              *gtime.Time                                  `json:"task_ddl"`
+	FreeStage            int                                          `json:"free_stage" ` // 免费领样阶段,1-5分别代表已申请、已拒绝、待发货、已发货、已收货',
+}
+
 type ListSecTaskSql struct {
 	TaskId                 string                                  `json:"task_id"`                       // 选品任务id
 	SelectionId            string                                  `json:"selection_id"`                  // 选品id
@@ -58,7 +81,6 @@ type ListSecTaskSql struct {
 	//YounggeeProductPhoto   *[]model.YounggeeProductPhoto // 商品图片表
 	TaskDdl   *gtime.Time `json:"task_ddl"`
 	FreeStage int         `json:"free_stage" ` // 免费领样阶段,1-5分别代表已申请、已拒绝、待发货、已发货、已收货',
-
 }
 
 type UpdateStageReq struct {

+ 32 - 1
app/system/sectask/sectask_service.go

@@ -40,7 +40,7 @@ func (s *secTaskService) List(ctx context.Context, listSecTaskReq *ListSecTaskRe
 		dao.YounggeeSecTaskInfo.Columns.TaskStage: taskStageList,
 		dao.YounggeeSecTaskInfo.Columns.TalentId:  tid,
 	}
-	err = dao.YounggeeSecTaskInfo.Ctx(ctx).Where(whereCondition).Scan(&res.SecTask)
+	err = dao.YounggeeSecTaskInfo.Ctx(ctx).WithAll().Where(whereCondition).Scan(&res.SecTask)
 	if err != nil {
 		return
 	}
@@ -122,6 +122,37 @@ func (s *secTaskService) List(ctx context.Context, listSecTaskReq *ListSecTaskRe
 	return
 }
 
+func (s *secTaskService) ListTab(listSecTaskTabReq *ListSecTaskTabReq, tid string) (res *ListSecTaskTabRes) {
+	//获得tab_stage
+	var whereStr string
+	//前端点击了那个tab  TabStage
+	switch listSecTaskTabReq.TabStage {
+	case 1:
+		// 返回指定talentId的所有数据
+		whereStr = fmt.Sprintf("talent_id='%s'", tid)
+	case 2:
+		// 返回指定talentId且free_stage为3, 4, 5的数据
+		whereStr = fmt.Sprintf("talent_id='%s' AND free_stage IN (3, 4, 5)", tid)
+	case 3:
+		// 返回指定talentId且sale_num_all大于0的数据
+		whereStr = fmt.Sprintf("talent_id='%s' AND sale_num_all > 0", tid)
+	case 4:
+		// 返回指定talentId且已过DDL的数据
+		whereStr = fmt.Sprintf("talent_id='%s' AND task_ddl < NOW()", tid)
+	}
+	//查task表全部数据
+	var secTaskInfoList []youngee_talent_model.SecTaskInfoDetail
+	err := g.DB().Model(youngee_talent_model.SecTaskInfoDetail{}).WithAll().
+		Where(whereStr).
+		Order("task_ddl DESC").
+		Scan(&secTaskInfoList)
+	if err != nil {
+		return &ListSecTaskTabRes{Count: -1, Msg: err.Error(), SecTaskTable: nil}
+	}
+	c := len(secTaskInfoList)
+	return &ListSecTaskTabRes{Count: c, Msg: "success", SecTaskTable: secTaskInfoList}
+}
+
 func UpdateStageAndStatus(ctx context.Context, updateStageReq *UpdateStageReq) (err error) {
 	whereCondition := g.Map{
 		dao.YounggeeSecTaskInfo.Columns.TaskId: updateStageReq.TaskId,

BIN
bin/main.exe


BIN
bin/main.exe~


+ 1 - 0
router/router.go

@@ -188,6 +188,7 @@ func init() {
 			group.Middleware(middleware.DuplicateVerify, middleware.WxAuth)
 			group.Group("/secTask", func(group *ghttp.RouterGroup) {
 				group.GET("/list", sectask.SecTask.List)
+				group.GET("/list-tab", sectask.SecTask.ListTab)
 				group.GET("/logistics/detail", sectask.SecTask.ShowLogisticsDetail)
 			})
 			group.Group("/assignment", func(group *ghttp.RouterGroup) {