瀏覽代碼

授权、快递接口

Yankun168 10 月之前
父節點
當前提交
7d06e44ed1
共有 32 個文件被更改,包括 849 次插入132 次删除
  1. 58 0
      app/api/youngee_talent_api/talent_auth_get_api.go
  2. 8 0
      app/api/youngee_talent_api/talent_auth_post_api.go
  3. 2 6
      app/dao/internal/younggee_sec_task_info.go
  4. 10 14
      app/model/model.go
  5. 14 0
      app/model/youngee_talent_model/kuaidi_resp.go
  6. 1 0
      app/model/youngee_talent_model/kuaishouAuth.go
  7. 1 0
      app/model/youngee_talent_model/product_info.go
  8. 2 3
      app/model/youngee_talent_model/selection.go
  9. 45 1
      app/model/youngee_talent_model/selection_task.go
  10. 126 63
      app/service/youngee_sectask_service/seletion_square.go
  11. 19 1
      app/service/youngee_talent_service/talent_account.go
  12. 4 1
      app/service/youngee_talent_service/talent_address.go
  13. 263 4
      app/service/youngee_talent_service/talent_ks_auth.go
  14. 1 1
      app/system/assignment/assignment_service.go
  15. 13 0
      app/system/sectask/sectask_api.go
  16. 49 36
      app/system/sectask/sectask_model.go
  17. 69 0
      app/system/sectask/sectask_service.go
  18. 1 0
      app/utils/GetInfoFromSession.go
  19. 142 0
      app/utils/kuaidi100.go
  20. 二進制
      bin/main.exe
  21. 二進制
      bin/v3.3.5/linux_amd64/youngmini_server
  22. 二進制
      bin/v3.3.5/windows_amd64/youngmini_server.exe
  23. 二進制
      bin/v3.3.6/linux_amd64/youngmini_server
  24. 二進制
      bin/v3.3.6/windows_amd64/youngmini_server.exe
  25. 二進制
      bin/v3.3.7/linux_amd64/youngmini_server
  26. 二進制
      bin/v3.3.7/windows_amd64/youngmini_server.exe
  27. 二進制
      bin/v3.4.1/linux_amd64/youngmini_server
  28. 二進制
      bin/v3.4.1/windows_amd64/youngmini_server.exe
  29. 1 1
      config/config.toml
  30. 7 0
      main.go
  31. 2 0
      middleware/middleware_wx_auth.go
  32. 11 1
      router/router.go

+ 58 - 0
app/api/youngee_talent_api/talent_auth_get_api.go

@@ -77,6 +77,15 @@ func (*talentAuthGetApi) GetTalentAccount(r *ghttp.Request) {
 	}
 }
 
+// platform_kuaishou_user_info
+func (*talentAuthGetApi) GetTalentAccountKuaishou(r *ghttp.Request) {
+	res := youngee_talent_service.GetTalentAccountKuaishou(r)
+	err := r.Response.WriteJson(res)
+	if err != nil {
+		panic("write response error")
+	}
+}
+
 // 达人抖音授权二维码展示
 func (*talentAuthGetApi) DisplayQrcode(r *ghttp.Request) {
 	res := youngee_talent_service.GetQrcode(r)
@@ -96,6 +105,15 @@ func (*talentAuthGetApi) CheckAccount(r *ghttp.Request) {
 	}
 }
 
+// 轮询用户是否扫码了,/kuangshouauth中删除老数据。此接口code=0时,说明查到了新数据进来。弹窗消失
+func (*talentAuthGetApi) CheckNewAccount(r *ghttp.Request) {
+	res := youngee_talent_service.CheckNewAccount(r)
+	err := r.Response.WriteJson(res)
+	if err != nil {
+		panic("write response error")
+	}
+}
+
 // 查30天销量(此时已经执行完了/kuaishouauth,在checkaccount的过程中执行此函数)
 func (*talentAuthGetApi) QuerySalesFor30Days(r *ghttp.Request) {
 	res := youngee_talent_service.QuerySalesFor30Days(r)
@@ -105,6 +123,46 @@ func (*talentAuthGetApi) QuerySalesFor30Days(r *ghttp.Request) {
 	}
 }
 
+// 查90天(有效销量)(查状态为60(已结算))
+func (*talentAuthGetApi) QueryOkSaleNum(r *ghttp.Request) {
+	res := youngee_talent_service.QueryOkSaleNum(r)
+	err := r.Response.WriteJson(res)
+	if err != nil {
+		panic("write response error")
+	}
+}
+
+// 查90天销量(全部销量)(此时已经执行完了/kuaishouauth,在checkaccount的过程中执行此函数)
+func (*talentAuthGetApi) QuerySalesFor90Days(r *ghttp.Request) {
+	res := youngee_talent_service.QuerySalesFor90Days(r)
+	err := r.Response.WriteJson(res)
+	if err != nil {
+		panic("write response error")
+	}
+}
+func (*talentAuthGetApi) CheckTokenExp(r *ghttp.Request) {
+	res := youngee_talent_service.CheckTokenExp(r)
+	err := r.Response.WriteJson(res)
+	if err != nil {
+		panic("write response error")
+	}
+}
+func (*talentAuthGetApi) AddWindow(r *ghttp.Request) {
+	res := youngee_talent_service.AddWindow(r)
+	err := r.Response.WriteJson(res)
+	if err != nil {
+		panic("write response error")
+	}
+}
+func (*talentAuthGetApi) GetKuaishouFansNum(r *ghttp.Request) {
+	fmt.Println("获取粉丝接口")
+	res := youngee_talent_service.GetKuaishouFansNum(r)
+	err := r.Response.WriteJson(res)
+	if err != nil {
+		panic("write response error")
+	}
+}
+
 // 判断达人是否登录
 func (*talentAuthGetApi) IsLogin(r *ghttp.Request) {
 	r.Response.Writeln("islogin接口检查")

+ 8 - 0
app/api/youngee_talent_api/talent_auth_post_api.go

@@ -217,3 +217,11 @@ func (*talentAuthPostApi) SignUpSecTask(r *ghttp.Request) {
 		panic("write response error")
 	}
 }
+
+func (*talentAuthPostApi) SignUpSecTaskFromWindow(r *ghttp.Request) {
+	res := youngee_sectask_service.SignUpSecTaskFromWindow(r)
+	err := r.Response.WriteJson(res)
+	if err != nil {
+		panic("write response error")
+	}
+}

+ 2 - 6
app/dao/internal/younggee_sec_task_info.go

@@ -1,7 +1,3 @@
-// ==========================================================================
-// Code generated by GoFrame CLI tool. DO NOT EDIT.
-// ==========================================================================
-
 package internal
 
 import (
@@ -49,10 +45,10 @@ type YounggeeSecTaskInfoColumns struct {
 	TeamId                 string // 作为团员的young之团id,对应younggee_talent_team中的team_id字段
 	TeamIncome             string // young之团团长现金收益
 	TeamPoint              string // young之团团长积分收益
-	ProductId              string    //商品id
+	ProductId              string //商品id
 }
 
-//  younggeeSecTaskInfoColumns holds the columns for table younggee_sec_task_info.
+// younggeeSecTaskInfoColumns holds the columns for table younggee_sec_task_info.
 var younggeeSecTaskInfoColumns = YounggeeSecTaskInfoColumns{
 	Id:                     "id",
 	TaskId:                 "task_id",

+ 10 - 14
app/model/model.go

@@ -1,14 +1,9 @@
-// =================================================================================
-// Code generated by GoFrame CLI tool. DO NOT EDIT.
-// =================================================================================
-
 package model
 
 import (
 	"github.com/gogf/gf/os/gtime"
 )
 
-
 // BobocoinDeductRecord is the golang structure for table bobocoin_deduct_record.
 type BobocoinDeductRecord struct {
 	RecordId       uint64      `orm:"record_id,primary" json:"record_id"`       // 扣费记录ID
@@ -1278,6 +1273,7 @@ type YounggeeSecTaskInfo struct {
 	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之团团长积分收益
+	SaleActual             int         `orm:"sale_actual"                json:"sale_actual"`              //s
 }
 
 // YounggeeSelectionInfo is the golang structure for table younggee_selection_info.
@@ -1318,15 +1314,15 @@ type YounggeeSelectionInfo struct {
 
 // YounggeeSketchInfo is the golang structure for table younggee_sketch_info.
 type YounggeeSketchInfo struct {
-	SketchId          int         `orm:"sketch_id,primary"    json:"sketch_id"`            // 初稿id
-	TaskId            string      `orm:"task_id"              json:"task_id"`              // 任务id
-	Title             string      `orm:"title"                json:"title"`                // 标题
-	Type              int         `orm:"type"                 json:"type"`                 // 初稿形式,1为图片,2为视频
-	Content           string      `orm:"content"              json:"content"`              // 正文
-	ReviseOpinion     string      `orm:"revise_opinion"       json:"revise_opinion"`       // 反馈意见
-	IsSubmit          int         `orm:"is_submit"            json:"is_submit"`            // 是否提交
-	IsReview          int         `orm:"is_review"            json:"is_review"`            // 是否审核
-	IsOk              int         `orm:"is_ok"                json:"is_ok"`                // 是否合格
+	SketchId      int    `orm:"sketch_id,primary"    json:"sketch_id"`      // 初稿id
+	TaskId        string `orm:"task_id"              json:"task_id"`        // 任务id
+	Title         string `orm:"title"                json:"title"`          // 标题
+	Type          int    `orm:"type"                 json:"type"`           // 初稿形式,1为图片,2为视频
+	Content       string `orm:"content"              json:"content"`        // 正文
+	ReviseOpinion string `orm:"revise_opinion"       json:"revise_opinion"` // 反馈意见
+	IsSubmit      int    `orm:"is_submit"            json:"is_submit"`      // 是否提交
+	IsReview      int    `orm:"is_review"            json:"is_review"`      // 是否审核
+	IsOk          int    `orm:"is_ok"                json:"is_ok"`          // 是否合格
 
 	CreateAt          *gtime.Time `orm:"create_at"            json:"create_at"`            // 创建时间
 	AgreeAt           *gtime.Time `orm:"agree_at"             json:"agree_at"`             // 同意时间

+ 14 - 0
app/model/youngee_talent_model/kuaidi_resp.go

@@ -0,0 +1,14 @@
+package youngee_talent_model
+
+type KdDetailItem struct {
+	Time    string `json:"time"`
+	Context string `json:"context"`
+}
+
+type KdState struct {
+	Message string          `json:"message"`
+	State   string          `json:"state"`
+	Status  string          `json:"status"`
+	IsCheck string          `json:"ischeck"`
+	Data    []*KdDetailItem `json:"data"`
+}

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

@@ -9,6 +9,7 @@ type KuaishouUserInfo struct {
 	gmeta.Meta   `orm:"table:platform_kuaishou_user_info"`
 	Id           int         `json:"id" orm:"id,primary"`
 	OpenId       string      `json:"open_id" orm:"open_id"`
+	PlatformId   int         `json:"platform_id" orm:"platform_id"`
 	TalentId     string      `json:"talent_id" orm:"talent_id"`
 	Code         string      `json:"code" orm:"code"`
 	AccessToken  string      `json:"access_token" orm:"access_token"`

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

@@ -9,6 +9,7 @@ import (
 type YounggeeProduct struct {
 	gmeta.Meta          `orm:"table:younggee_product"`
 	ProductId           int         `json:"product_id"`           // 商品id
+	KuaishouProductId   int64       `json:"kuaishou_product_id"`  // 快手中实际商品id
 	ProductName         string      `json:"product_name"`         // 商品名称
 	ProductType         int         `json:"product_type"`         // 商品类型
 	ShopAddress         string      `json:"shop_address"`         // 店铺地址,商品类型为线下品牌时需填写

+ 2 - 3
app/model/youngee_talent_model/selection.go

@@ -95,12 +95,12 @@ type SelectionDetail struct {
 	SelectionName        string                  `json:"selection_name"`                // 选品项目名称
 	SelectionId          string                  `json:"selection_id"`                  // 选品项目id
 	EnterpriseId         string                  `json:"enterprise_id"`                 // 所属企业id
-	ProductId            int                     `json:"product_id"`                    // 关联商品id
+	ProductId            int                     `json:"product_id"`                    // 商品id(主键)
 	ContentType          int                     `json:"content_type"`                  // 内容形式,1代表图文,2代表视频
 	SelectionStatus      int                     `json:"selection_status"`              // 选品项目状态,1-10分别代表创建中、待审核、审核通过、招募中、招募完毕、待支付、已支付、失效、执行中、已结案
 	TaskMode             int                     `json:"task_mode"`                     // 任务形式,1、2分别表示悬赏任务、纯佣带货
 	Platform             int                     `json:"platform"`                      // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
-	SampleMode           int                     `json:"sample_mode"`                   // 领样形式,1、2分别表示免费领样、垫付领样
+	SampleMode           int                     `json:"sample_mode"`                   // 领样形式,1、2、3分别表示免费领样、垫付领样、不提供
 	ProductUrl           string                  `json:"product_url"`                   // 带货链接
 	SampleNum            int                     `json:"sample_num"`                    // 样品数量
 	RemainNum            int                     `json:"remain_num"`                    // 剩余数量
@@ -121,7 +121,6 @@ type SelectionDetail struct {
 	ProductSnap          string                  `json:"product_snap"`                  // 商品信息快照
 	ProductPhotoSnap     string                  `json:"product_photo_snap"`            // 商品图片快照
 	SubmitAt             *gtime.Time             `json:"submit_at"`                     // 提交审核时间
-	RemainRewardPoll     int                     `json:"remain_reward_poll"`            // 悬赏池中剩余的金额
 	SelectionBrief       []*SelectionBrief       `orm:"with:selection_id=selection_id"` // 项目brief 一个selection可能有多个brief,用列表
 	SelectionExample     []*SelectionExample     `orm:"with:selection_id=selection_id"` // 项目样例图
 	FreeStrategy         []*FreeStrategy         `orm:"with:selection_id=selection_id"` // 领样策略表

+ 45 - 1
app/model/youngee_talent_model/selection_task.go

@@ -11,6 +11,8 @@ type SignSecTaskReq struct {
 	AddressId   uint64 `json:"address_id"`
 	LeadTeamId  string `json:"lead_team_id"`
 	TeamId      string `json:"team_id"`
+	SaleNum     int    `json:"saleNum"`
+	FansNum     int    `json:"fans"`
 }
 
 type SignSecTaskResp struct {
@@ -31,7 +33,7 @@ type SecTaskInfoDetail struct {
 	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分别表示纯佣带货、悬赏任务
+	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表
@@ -50,6 +52,48 @@ type SecTaskInfoDetail struct {
 	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表示已出单)
+}
+
+type SecTaskInfoWindowDetail 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"` // 粉丝数
 }
 
 type SecTaskInfoBrief struct {

+ 126 - 63
app/service/youngee_sectask_service/seletion_square.go

@@ -191,34 +191,6 @@ func GetSelectionDetail(r *ghttp.Request) *TalentHttpResult {
 	if err != nil {
 		return &TalentHttpResult{Code: -3, Msg: err.Error()}
 	}
-	//
-	//// 查询free_strategy表数据
-	//var freeStrategy []*youngee_talent_model.FreeStrategy
-	//err = g.DB().Model(youngee_talent_model.FreeStrategy{}).WithAll().Where("selection_id", sid).Scan(&freeStrategy)
-	//if err != nil {
-	//	return &TalentHttpResult{Code: -3, Msg: err.Error()}
-	//}
-	//
-	//// 查询reward_strategy表数据
-	//var rewardStrategy []*youngee_talent_model.RewardStrategy
-	//err = g.DB().Model(youngee_talent_model.RewardStrategy{}).WithAll().Where("selection_id", sid).Scan(&rewardStrategy)
-	//if err != nil {
-	//	return &TalentHttpResult{Code: -3, Msg: err.Error()}
-	//}
-
-	////查询younggee_sec_brief表数据
-	//var selectionBrief []*youngee_talent_model.SelectionBrief
-	//err = g.DB().Model(youngee_talent_model.SelectionBrief{}).WithAll().Where("selection_id", sid).Scan(&selectionBrief)
-	//if err != nil {
-	//	return &TalentHttpResult{Code: -3, Msg: err.Error()}
-	//}
-	//
-	////查询younggee_sec_example表数据
-	//var selectionExample []*youngee_talent_model.SelectionExample
-	//err = g.DB().Model(youngee_talent_model.SelectionExample{}).WithAll().Where("selection_id", sid).Scan(&selectionExample)
-	//if err != nil {
-	//	return &TalentHttpResult{Code: -3, Msg: err.Error()}
-	//}
 	// 查询younggee_product表数据
 	var younggeeProduct []*youngee_talent_model.YounggeeProduct
 	err = g.DB().Model(youngee_talent_model.YounggeeProduct{}).WithAll().Where("product_id", pid).Scan(&younggeeProduct)
@@ -261,7 +233,7 @@ func GetProductPhoto(r *ghttp.Request) *TalentHttpResult {
 	return nil
 }
 
-// 判断是否已报名任务
+// 判断是否已报名任务,如果是提供免费领样(按钮既然有肯定是免费领样),sectask中的sample_mode==3,或者没有数据。表示还没报名,只是添加橱窗了
 func IsSignUpSecTask(r *ghttp.Request) *TalentHttpResult {
 	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
 	if err != nil {
@@ -275,13 +247,15 @@ func IsSignUpSecTask(r *ghttp.Request) *TalentHttpResult {
 		return &TalentHttpResult{Code: -1, Msg: err.Error()}
 	}
 	isSign := youngee_talent_model.IsSignSecTask{}
-	if len(task) != 0 {
+	//如果有数据且sample_mode==3说明没有报名,否则报名了
+
+	//有数据且sample_mode==1说明报名了,否则没报名  &&左边为false就不执行了
+	if len(task) != 0 && task[0].SampleMode == 1 {
 		isSign.SecTaskInfo = &task[0]
 		isSign.IsSign = 1
 	} else {
 		isSign.IsSign = 0
 	}
-	fmt.Println("判断报名*********", isSign.IsSign)
 	return &TalentHttpResult{Code: 0, Msg: "success", Data: isSign}
 }
 
@@ -292,16 +266,14 @@ func SignUpSecTask(r *ghttp.Request) *TalentHttpResult {
 		return &TalentHttpResult{Code: -1, Msg: "Get talent info failed"}
 	}
 
-	// 解析body/json参数
+	// 解析前端传来的参数
 	var signSecTaskReq *youngee_talent_model.SignSecTaskReq
 	err = r.ParseForm(&signSecTaskReq)
-	fmt.Println("****************", signSecTaskReq.ProductId)
-	fmt.Println("****************", signSecTaskReq.SelectionId)
 	if err != nil {
 		return &TalentHttpResult{Code: -2, Msg: "parse param error"}
 	}
 
-	// 查询选品详情
+	// 查得的selectionDetail包含product、photo、策略表等综合数据
 	var selectionDetail *youngee_talent_model.SelectionDetail
 	err = g.DB().Model(youngee_talent_model.SelectionDetail{}).WithAll().Where("selection_id", signSecTaskReq.SelectionId).Scan(&selectionDetail)
 	if err != nil {
@@ -360,6 +332,8 @@ func SignUpSecTask(r *ghttp.Request) *TalentHttpResult {
 		TaskId:                 newTaskId,
 		SelectionId:            signSecTaskReq.SelectionId,
 		ProductId:              signSecTaskReq.ProductId,
+		SaleNum:                signSecTaskReq.SaleNum,
+		FansNum:                signSecTaskReq.FansNum,
 		TalentId:               tid,
 		AccountId:              accountInfo.AccountId,
 		TalentPlatformInfoSnap: string(accountSnap),
@@ -371,6 +345,7 @@ func SignUpSecTask(r *ghttp.Request) *TalentHttpResult {
 		IsPayReward:            0,
 		TaskMode:               selectionDetail.TaskMode,
 		SampleMode:             selectionDetail.SampleMode,
+		FreeStage:              1, //领样状态:已申请    悬赏状态默认为0
 		TaskStage:              3,
 		TaskStatus:             1,
 		CreateDate:             gtime.Now(),
@@ -385,34 +360,14 @@ func SignUpSecTask(r *ghttp.Request) *TalentHttpResult {
 		TeamPoint:              0,
 		SelectionDetail:        selectionDetail,
 	}
-	// 新建选品任务
-	//secTaskInfo := model.YounggeeSecTaskInfo{
-	//	TaskId:                 newTaskId,
-	//	SelectionId:            signSecTaskReq.SelectionId,
-	//	TalentId:               tid,
-	//	AccountId:              accountInfo.AccountId,
-	//	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,
-	//	TaskStage:              3,
-	//	TaskStatus:             1,
-	//	CreateDate:             gtime.Now(),
-	//	CompleteStatus:         1,
-	//	LogisticsStatus:        1,
-	//	AssignmentStatus:       1,
-	//	UpdateAt:               gtime.Now(),
-	//	WithdrawStatus:         1,
-	//	LeadTeamId:             signSecTaskReq.LeadTeamId,
-	//	TeamId:                 signSecTaskReq.TeamId,
-	//	TeamIncome:             0,
-	//	TeamPoint:              0,
-	//}
+
+	//删除添加橱窗时创建的不完整的数据
+	_, err = g.DB().Model("younggee_sec_task_info").
+		Where("talent_id = ? AND selection_id = ? ", tid, signSecTaskReq.SelectionId).
+		Delete()
+	if err != nil {
+		return &TalentHttpResult{Code: -17, Msg: "younggee_sec_task_info delete failed"}
+	}
 
 	err = g.DB().Transaction(context.TODO(), func(ctx context.Context, tx *gdb.TX) error {
 		// young之团收益计算
@@ -506,7 +461,115 @@ func SignUpSecTask(r *ghttp.Request) *TalentHttpResult {
 				return err
 			}
 		}
+		return nil
+	})
+	if err != nil {
+		return &TalentHttpResult{Code: -18, Msg: "add Task data failed"}
+	}
+
+	signSecTaskResp := youngee_talent_model.SignSecTaskResp{
+		TaskId: newTaskId,
+	}
 
+	return &TalentHttpResult{Code: 0, Msg: "success", Data: signSecTaskResp}
+	//return &TalentHttpResult{Code: 0, Msg: "success", Data: selectionDetail}
+}
+
+func SignUpSecTaskFromWindow(r *ghttp.Request) *TalentHttpResult {
+
+	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
+	if err != nil {
+		return &TalentHttpResult{Code: -1, Msg: "Get talent info failed"}
+	}
+	// 解析body/json参数
+	var signSecTaskReq *youngee_talent_model.SignSecTaskReq
+	err = r.ParseForm(&signSecTaskReq)
+	if err != nil {
+		return &TalentHttpResult{Code: -2, Msg: "parse param error"}
+	}
+	// 查询选品详情
+	var selectionDetail *youngee_talent_model.SelectionDetail
+	err = g.DB().Model(youngee_talent_model.SelectionDetail{}).WithAll().Where("selection_id", signSecTaskReq.SelectionId).Scan(&selectionDetail)
+	if err != nil {
+		return &TalentHttpResult{Code: -3, Msg: err.Error()}
+	}
+	var product model.YounggeeProduct
+	err = json.Unmarshal([]byte(selectionDetail.ProductSnap), &product)
+	if err != nil {
+		return &TalentHttpResult{Code: -3, Msg: "json Unmarshal failed"}
+	}
+	// 查询达人详情
+	var talentInfo *youngee_talent_model.TalentInfo
+	err = g.DB().Model("youngee_talent_info").WithAll().Where("id", tid).Scan(&talentInfo)
+	if err != nil {
+		return &TalentHttpResult{Code: -4, Msg: "Get talent info failed"}
+	}
+	// 社媒账号详情
+	var accountInfo *youngee_talent_model.PlatformAccountInfo
+	err = g.DB().Model("youngee_platform_account_info").WithAll().Where("talent_id = ? and platform_id = ?", tid, selectionDetail.Platform).Scan(&accountInfo)
+	if err != nil {
+		return &TalentHttpResult{Code: -5, Msg: err.Error()}
+	}
+	var newTaskId string
+	// 首先生成任务id
+	newTaskId = utils.GetUuid.GetTaskId(selectionDetail.SelectionId, selectionDetail.EnterpriseId, tid)
+	// 生成达人平台账号信息快照
+	accountSnap, err := gjson.Encode(accountInfo)
+	if err != nil {
+		return &TalentHttpResult{Code: -7, Msg: "encode platform snap failed"}
+	}
+	// 生成达人信息快照
+	talentSnap, err := gjson.Encode(talentInfo)
+	if err != nil {
+		return &TalentHttpResult{Code: -8, Msg: "encode talent info snap failed"}
+	}
+	secTaskInfo := youngee_talent_model.SecTaskInfoWindowDetail{
+		TaskId:                 newTaskId,
+		SelectionId:            signSecTaskReq.SelectionId,
+		ProductId:              signSecTaskReq.ProductId,
+		SaleNum:                signSecTaskReq.SaleNum,
+		FansNum:                signSecTaskReq.FansNum,
+		TalentId:               tid,
+		AccountId:              accountInfo.AccountId,
+		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,
+		SampleMode:       3, //添加橱窗,当作不提供领样处理
+		TaskStage:        3,
+		TaskStatus:       1,
+		CreateDate:       gtime.Now(),
+		CompleteStatus:   1,
+		LogisticsStatus:  1,
+		AssignmentStatus: 1,
+		UpdateAt:         gtime.Now(),
+		WithdrawStatus:   1,
+		LeadTeamId:       signSecTaskReq.LeadTeamId,
+		TeamId:           signSecTaskReq.TeamId,
+		TeamIncome:       0,
+		TeamPoint:        0,
+		SelectionDetail:  selectionDetail,
+	}
+	//如果已经有数据了,删除。模拟在快手侧里把橱窗商品删了,想再加回来
+	//删除添加橱窗时创建的不完整的数据
+	_, err = g.DB().Model("younggee_sec_task_info").
+		Where("talent_id = ? AND selection_id = ? ", tid, signSecTaskReq.SelectionId).
+		Delete()
+	if err != nil {
+		return &TalentHttpResult{Code: -17, Msg: "younggee_sec_task_info delete failed"}
+	}
+
+	err = g.DB().Transaction(context.TODO(), func(ctx context.Context, tx *gdb.TX) error {
+		// 新建任务,初始化状态为待确认
+		_, err = tx.Ctx(ctx).Model(dao.YounggeeSecTaskInfo.Table).Data(&secTaskInfo).Insert()
+		if err != nil {
+			return err
+		}
 		return nil
 	})
 	if err != nil {

+ 19 - 1
app/service/youngee_talent_service/talent_account.go

@@ -14,7 +14,6 @@ func GetTalentAccount(r *ghttp.Request) *TalentHttpResult {
 	//达人id获取
 	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
 	//定义除了youngee_platform_account_info表结构外额外还有info_third_platform的结构体(用表连接)
-
 	if err != nil {
 		return &TalentHttpResult{Code: -1, Msg: "Get talent info failed"}
 	}
@@ -32,6 +31,25 @@ func GetTalentAccount(r *ghttp.Request) *TalentHttpResult {
 	return &TalentHttpResult{Code: 0, Msg: "success", Data: res}
 }
 
+func GetTalentAccountKuaishou(r *ghttp.Request) *TalentHttpResult {
+	//达人id获取
+	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
+	if err != nil {
+		return &TalentHttpResult{Code: -1, Msg: "Get talent info failed"}
+	}
+	//查找给定达人id之后,该达人绑定了几个平台的账号
+	res, err := g.DB().Model("platform_kuaishou_user_info").All("talent_id", tid)
+	if err != nil {
+		return &TalentHttpResult{Code: -2, Msg: "query database error"}
+	}
+
+	if res == nil {
+		return &TalentHttpResult{Code: -3, Msg: "未绑定任何平台"}
+	}
+
+	return &TalentHttpResult{Code: 0, Msg: "success", Data: res}
+}
+
 func OnAddTalentAccount(r *ghttp.Request) *TalentHttpResult {
 	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
 	if err != nil {

+ 4 - 1
app/service/youngee_talent_service/talent_address.go

@@ -74,7 +74,10 @@ func OnAddTalentAddress(r *ghttp.Request) *TalentHttpResult {
 
 	err = g.DB().Transaction(context.TODO(), func(ctx context.Context, tx *gdb.TX) error {
 		var tErr error
-
+		//等价于
+		//UPDATE talent_info
+		//SET is_bind_location = 1
+		//WHERE id = ?
 		_, tErr = tx.Ctx(ctx).Model(dao.YoungeeTalentInfo.Table).Update("is_bind_location=1", "id", tid)
 		if err != nil {
 			return tErr

+ 263 - 4
app/service/youngee_talent_service/talent_ks_auth.go

@@ -6,13 +6,21 @@ import (
 	"github.com/chromedp/chromedp"
 	"github.com/gogf/gf/frame/g"
 	"github.com/gogf/gf/net/ghttp"
+	"github.com/gogf/gf/os/gtime"
 	"github.com/lin-jim-leon/kuaishou/open/merchant"
+	"github.com/lin-jim-leon/kuaishou/open/user"
 	"log"
 	"time"
 	"youngmini_server/app/model/youngee_talent_model"
 	"youngmini_server/app/utils"
 )
 
+const (
+	ClientKey    = "ks651333097154138217"
+	ClientSecret = "dBt0rVRhTpUqcrOYGGpv0A"
+	SignSecret   = "bf6393dce0a2b669ee348bebb837b0da"
+)
+
 func GetQrcode(r *ghttp.Request) *TalentHttpResult {
 	//达人id获取
 	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
@@ -59,6 +67,7 @@ func GetQrcode(r *ghttp.Request) *TalentHttpResult {
 	return &TalentHttpResult{Code: 0, Msg: "success", Data: text}
 }
 
+// 检查数据库表中是否有达人对应的数据
 func CheckAccount(r *ghttp.Request) *TalentHttpResult {
 	fmt.Println("into check")
 	//达人id获取
@@ -77,6 +86,101 @@ func CheckAccount(r *ghttp.Request) *TalentHttpResult {
 	return &TalentHttpResult{Code: 0, Msg: "success", Data: userInfo}
 }
 
+// 检查数据库表中是否有达人对应的数据,有就删掉,/kuaishouath中会插入。
+func CheckNewAccount(r *ghttp.Request) *TalentHttpResult {
+	//check到了更新时间在两秒内的插入的数据。则说明已绑定。弹窗消失。
+	//达人id获取
+	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
+	if err != nil {
+		return &TalentHttpResult{Code: -1, Msg: "Get talent id failed"}
+	}
+	// 获取当前时间
+	currentTime := gtime.Now()
+	// 查询数据库中是否有符合条件的数据
+	userInfo := &youngee_talent_model.KuaishouUserInfo{}
+	err = g.DB().Model("platform_kuaishou_user_info").
+		Where("talent_id = ?", tid).
+		Scan(&userInfo)
+	if err != nil {
+		return &TalentHttpResult{Code: -2, Msg: "platform_kuaishou_user_info query failed"}
+	}
+	//找到数据,判断时间差
+	if userInfo != nil {
+		// 计算创建时间与当前时间的差值
+		timeDiff := currentTime.Sub(userInfo.CreateTime)
+		fmt.Println("***********kifasfa", timeDiff)
+		if timeDiff <= 3*time.Second {
+			return &TalentHttpResult{Code: 0, Msg: "success", Data: nil}
+		}
+	}
+	// 如果没有符合条件的数据,返回失败
+	return &TalentHttpResult{Code: -20, Msg: "No valid data found", Data: nil}
+}
+func CheckTokenExp(r *ghttp.Request) *TalentHttpResult {
+	//达人id获取
+	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
+	if err != nil {
+		return &TalentHttpResult{Code: -1, Msg: "Get talent id failed"}
+	}
+	key, err1 := g.DB().Model("platform_kuaishou_user_info").Fields("access_token").Where("talent_id = ?", tid).Value()
+	if err1 != nil {
+		return &TalentHttpResult{Code: -1, Msg: "query database fail"}
+	}
+	AccessToken := key.String()
+	res_info, err2 := user.GetUserinfo(ClientKey, AccessToken)
+	if err2 != nil {
+		//前端接收code=-2表示token过期
+		return &TalentHttpResult{Code: -2, Msg: "accessToken过期", Data: nil}
+	}
+	// 查询成功,返回成功结果和数据
+	return &TalentHttpResult{Code: 0, Msg: "success", Data: res_info}
+}
+
+func AddWindow(r *ghttp.Request) *TalentHttpResult {
+	pId := r.GetString("product_id")
+	//pId := "66666"
+
+	//通过pId获取kuaishou_product_id
+	pIdSlice := []string{pId}
+	//达人id获取
+	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
+	if err != nil {
+		return &TalentHttpResult{Code: -1, Msg: "Get talent id failed"}
+	}
+	key, err1 := g.DB().Model("platform_kuaishou_user_info").Fields("access_token").Where("talent_id = ?", tid).Value()
+	if err1 != nil {
+		return &TalentHttpResult{Code: -2, Msg: "query database fail"}
+	}
+	AccessToken := key.String()
+	res_info, err2 := merchant.AddItemsToShelf(ClientKey, SignSecret, AccessToken, pIdSlice)
+	if err2 != nil {
+		//前端接收code=-3表示添加失敗,沒有開通
+		return &TalentHttpResult{Code: -3, Msg: "未開通、商品不存在或已下线", Data: nil}
+	}
+	// 查询成功,返回成功结果和数据
+	return &TalentHttpResult{Code: 0, Msg: "加入橱窗成功", Data: res_info}
+}
+func GetKuaishouFansNum(r *ghttp.Request) *TalentHttpResult {
+	//达人id获取
+	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
+	fmt.Println("********&&&&&&&&&&,tid", tid)
+	if err != nil {
+		return &TalentHttpResult{Code: -1, Msg: "Get talent id failed"}
+	}
+	key, err1 := g.DB().Model("platform_kuaishou_user_info").Fields("access_token").Where("talent_id = ?", tid).Value()
+	if err1 != nil {
+		return &TalentHttpResult{Code: -2, Msg: "query database fail"}
+	}
+	AccessToken := key.String()
+	res_user, err2 := user.GetUserinfo(ClientKey, AccessToken)
+	if err2 != nil {
+		//前端接收code=-3表示添加失敗,沒有開通
+		return &TalentHttpResult{Code: -3, Msg: "获取快手用户信息出错", Data: nil}
+	}
+	// 查询成功,返回成功结果和数据
+	return &TalentHttpResult{Code: 0, Msg: "获取快手用户信息成功", Data: res_user.Data}
+}
+
 func QuerySalesFor30Days(r *ghttp.Request) *TalentHttpResult {
 	fmt.Println("into querySalesFor30Days")
 	ClientKey := "ks651333097154138217"
@@ -94,12 +198,8 @@ func QuerySalesFor30Days(r *ghttp.Request) *TalentHttpResult {
 		// 处理错误
 		fmt.Println("Error querying access_token:", err)
 	}
-
 	// 输出查询到的 access_token 值
 	fmt.Println("Access Token:", AccessToken)
-
-	//循环使用接口
-	//
 	// 获取当前时间的时间戳(毫秒)
 	currentTime := time.Now().UnixNano() / int64(time.Millisecond)
 	// 30天前的时间戳(毫秒)
@@ -131,11 +231,112 @@ func QuerySalesFor30Days(r *ghttp.Request) *TalentHttpResult {
 	return &TalentHttpResult{Code: 0, Msg: "获取30天销售量成功", Data: saleNum}
 }
 
+func QueryOkSaleNum(r *ghttp.Request) *TalentHttpResult {
+	tid, _ := utils.SessionTalentInfo.GetTalentIdFromSession(r)
+	// 创建一个 KuaishouUserInfo 结构体的实例
+	userInfo := &youngee_talent_model.KuaishouUserInfo{}
+
+	// 查询数据库中的 access_token 字段
+	// 使用 g.DB() 获取数据库连接,并执行查询
+	key, err := g.DB().Model(userInfo).Fields("access_token").Where("talent_id = ?", tid).Value()
+	AccessToken := key.String()
+	if err != nil {
+		// 处理错误
+		fmt.Println("Error querying access_token:", err)
+	}
+	if key == nil {
+		// 处理错误
+		fmt.Println("can not find talentId's bindinfo :", err)
+	}
+	//循环使用接口
+	//
+	// 获取当前时间的时间戳(毫秒)
+	currentTime := time.Now().UnixNano() / int64(time.Millisecond)
+	// 90天前的时间戳(毫秒)
+	beginTime90DaysAgo := currentTime - 90*24*60*60*1000
+	// 定义每段查询的天数
+	intervalDays := 7
+	intervalMillis := int64(intervalDays * 24 * 60 * 60 * 1000)
+
+	// 初始化 beginTime 和 endTime
+	beginTime := beginTime90DaysAgo
+	endTime := beginTime + intervalMillis
+	saleNum := 0 //90天总销量
+	// 循环查询,先处理四个7天的时间段
+	for i := 0; i < 12; i++ {
+		// 调整 endTime,确保不会超过当前时间
+		if endTime > currentTime {
+			endTime = currentTime
+		}
+		saleNum += GetSaleNumByDayInterval_Ok(ClientKey, SignSecret, AccessToken, beginTime, endTime)
+		// 更新时间段
+		beginTime = endTime
+		endTime = beginTime + intervalMillis
+	}
+
+	// 最后处理剩余的6天时间段
+	endTime = currentTime
+	saleNum += GetSaleNumByDayInterval_Ok(ClientKey, SignSecret, AccessToken, beginTime, endTime)
+	// 查询成功,返回成功结果和数据
+	return &TalentHttpResult{Code: 0, Msg: "获取30天销售量成功", Data: saleNum}
+}
+
+func QuerySalesFor90Days(r *ghttp.Request) *TalentHttpResult {
+	tid, _ := utils.SessionTalentInfo.GetTalentIdFromSession(r)
+	// 创建一个 KuaishouUserInfo 结构体的实例
+	userInfo := &youngee_talent_model.KuaishouUserInfo{}
+
+	// 查询数据库中的 access_token 字段
+	// 使用 g.DB() 获取数据库连接,并执行查询
+	key, err := g.DB().Model(userInfo).Fields("access_token").Where("talent_id = ?", tid).Value()
+	AccessToken := key.String()
+	if err != nil {
+		// 处理错误
+		fmt.Println("Error querying access_token:", err)
+	}
+	if key == nil {
+		// 处理错误
+		fmt.Println("can not find talentId's bindinfo :", err)
+	}
+	//循环使用接口
+	//
+	// 获取当前时间的时间戳(毫秒)
+	currentTime := time.Now().UnixNano() / int64(time.Millisecond)
+	// 30天前的时间戳(毫秒)
+	beginTime90DaysAgo := currentTime - 90*24*60*60*1000
+	// 定义每段查询的天数
+	intervalDays := 7
+	intervalMillis := int64(intervalDays * 24 * 60 * 60 * 1000)
+
+	// 初始化 beginTime 和 endTime
+	beginTime := beginTime90DaysAgo
+	endTime := beginTime + intervalMillis
+	saleNum := 0 //90天总销量
+	// 循环查询,先处理四个7天的时间段
+	for i := 0; i < 12; i++ {
+		// 调整 endTime,确保不会超过当前时间
+		if endTime > currentTime {
+			endTime = currentTime
+		}
+		saleNum += GetSaleNumByDayInterval(ClientKey, SignSecret, AccessToken, beginTime, endTime)
+		// 更新时间段
+		beginTime = endTime
+		endTime = beginTime + intervalMillis
+	}
+
+	// 最后处理剩余的6天时间段
+	endTime = currentTime
+	saleNum += GetSaleNumByDayInterval(ClientKey, SignSecret, AccessToken, beginTime, endTime)
+	// 查询成功,返回成功结果和数据
+	return &TalentHttpResult{Code: 0, Msg: "获取30天销售量成功", Data: saleNum}
+}
+
 func GetSaleNumByDayInterval(ClientKey string, SignSecret string, AccessToken string, beginTime int64, endTime int64) int {
 	pageSize := 100
 	totalSaleNum := 0
 
 	// 定义要查询的订单状态
+	// [30:已付款] [50:已收货] [60:已结算] [80:已失效]
 	statuses := []int{30, 50, 60}
 
 	// 遍历所有订单状态并调用 Corderlist 函数
@@ -187,3 +388,61 @@ func GetSaleNumByDayInterval(ClientKey string, SignSecret string, AccessToken st
 	}
 	return totalSaleNum
 }
+
+func GetSaleNumByDayInterval_Ok(ClientKey string, SignSecret string, AccessToken string, beginTime int64, endTime int64) int {
+	pageSize := 100
+	totalSaleNum := 0
+
+	// 定义要查询的订单状态
+	// [30:已付款] [50:已收货] [60:已结算] [80:已失效]
+	statuses := []int{60}
+
+	// 遍历所有订单状态并调用 Corderlist 函数
+	for _, status := range statuses {
+		// 初始化 pcursor
+		pcursor := ""
+
+		for {
+			// 调用 Corderlist 函数获取订单列表
+			response, err := merchant.Corderlist(ClientKey, SignSecret, AccessToken, status, pageSize, beginTime, endTime, pcursor)
+			fmt.Println("response********", response)
+			if err != nil {
+				fmt.Printf("Error calling Corderlist: %v\n", err)
+				break
+			}
+
+			// 检查响应代码
+			if response.Code != "1" {
+				fmt.Printf("Corderlist response error: %s\n", response.Msg)
+				break
+			}
+
+			// 累加订单中商品的数量
+			for _, order := range response.Data.OrderViews {
+				for _, product := range order.CPSOrderProductViews {
+					totalSaleNum += product.Num
+				}
+			}
+
+			// 检查分页指针 pcursor
+			//100个订单以内的情况
+			if response.Data.Cursor == "nomore" {
+				break
+			}
+			//大于等于100个订单
+			// 更新 pcursor 以获取下一页数据
+			pcursor = response.Data.Cursor
+
+			// 处理分页后的数据
+			// 如果 pcursor 不是 "nomore",我们需要累加最后一条订单的数量
+			if len(response.Data.OrderViews) > 0 {
+				lastOrder := response.Data.OrderViews[len(response.Data.OrderViews)-1]
+				if len(lastOrder.CPSOrderProductViews) > 0 {
+					lastProduct := lastOrder.CPSOrderProductViews[len(lastOrder.CPSOrderProductViews)-1]
+					totalSaleNum += lastProduct.Num
+				}
+			}
+		}
+	}
+	return totalSaleNum
+}

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

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

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

@@ -24,3 +24,16 @@ func (*secTaskApi) List(r *ghttp.Request) {
 		response.SuccessWithData(r, res)
 	}
 }
+
+func (*secTaskApi) ShowLogisticsDetail(r *ghttp.Request) {
+	var taskId = r.Get("task_id").(string)
+	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
+	if err != nil {
+		response.Code(r, err)
+	}
+	if res, err := service.ShowLogisticsDetail(r.Context(), tid, taskId); err != nil {
+		response.Code(r, err)
+	} else {
+		response.SuccessWithData(r, res)
+	}
+}

+ 49 - 36
app/system/sectask/sectask_model.go

@@ -2,6 +2,7 @@ package sectask
 
 import (
 	"github.com/gogf/gf/os/gtime"
+	"youngmini_server/app/model/youngee_talent_model"
 	_ "youngmini_server/app/model/youngee_talent_model"
 )
 
@@ -16,43 +17,48 @@ type ListSecTaskRes struct {
 }
 
 type ListSecTaskSql 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
-	AccountId              int         `json:"account_id"`                // 账号id
-	TalentPlatformInfoSnap string      `json:"talent_platform_info_snap"` // 达人平台信息快照
-	TalentPersonalInfoSnap string      `json:"talent_personal_info_snap"` // 达人个人信息快照
-	TalentPostAddrSnap     string      `json:"talent_post_addr_snap"`     // 收货地址快照
-	TaskReward             float64     `json:"task_reward"`               // 达人赏金
-	TalentPayment          float64     `json:"talent_payment"`            // 达人垫付金额
-	IsPayPayment           int         `json:"is_pay_payment"`            // 企业是否返样品钱
-	IsPayReward            int         `json:"is_pay_reward"`             // 企业是否结算悬赏
-	TaskMode               int         `json:"task_mode"`                 // 任务形式,1、2分别表示纯佣带货、悬赏任务
-	SampleMode             int         `json:"sample_mode"`               // 领样形式,1-3分别表示免费领样、垫付买样、不提供样品
-	TaskStatus             int         `json:"task_status"`               // 任务状态 1待选 2已选 3落选
-	TaskStage              int         `json:"task_stage"`                // 任务阶段,详情见info_sec_task_stage表
-	CreateDate             *gtime.Time `json:"create_date"`               // 创建时间
-	SelectDate             *gtime.Time `json:"select_date"`               // 反选时间
-	DeliveryDate           *gtime.Time `json:"delivery_date"`             // 发货时间
-	CompleteDate           *gtime.Time `json:"complete_date"`             // 结束时间
-	WithdrawDate           *gtime.Time `json:"withdraw_date"`             // 提现时间
-	CompleteStatus         int         `json:"complete_status"`           // 结束方式 1未结束 2正常结束 3反选失败
-	LogisticsStatus        int         `json:"logistics_status"`          // 发货状态 1 待发货 2已发货 3 已签收
-	AssignmentStatus       uint        `json:"assignment_status"`         // 作业上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
-	UpdateAt               *gtime.Time `json:"update_at"`                 // 更新时间
-	WithdrawStatus         int         `json:"withdraw_status"`           // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现
-	LeadTeamId             string      `json:"lead_team_id"`              // 作为团长的young之团id,对应younggee_talent_team中的team_id字段
-	TeamId                 string      `json:"team_id"`                   // 作为团员的young之团id,对应younggee_talent_team中的team_id字段
-	TeamIncome             float64     `json:"team_income"`               // young之团团长现金收益
-	TeamPoint              int         `json:"team_point"`                // young之团团长积分收益
-	PlatformIconUrl        string      `json:"platform_icon_url"`
-	PlatformName           string      `json:"platform_name"`
-	PlatformNickName       string      `json:"platform_nick_name"`
-	SelectionName          string      `json:"selection_name"`
-	ProductPhotoSnap       string      `json:"product_photo_snap"`
+	TaskId                 string                                  `json:"task_id"`                       // 选品任务id
+	SelectionId            string                                  `json:"selection_id"`                  // 选品id
+	ProductId              int                                     `json:"product_id"`                    // 商品id
+	TalentId               string                                  `json:"talent_id"`                     // 达人id
+	AccountId              int                                     `json:"account_id"`                    // 账号id
+	TalentPlatformInfoSnap string                                  `json:"talent_platform_info_snap"`     // 达人平台信息快照
+	TalentPersonalInfoSnap string                                  `json:"talent_personal_info_snap"`     // 达人个人信息快照
+	TalentPostAddrSnap     string                                  `json:"talent_post_addr_snap"`         // 收货地址快照
+	TaskReward             float64                                 `json:"task_reward"`                   // 达人赏金
+	TalentPayment          float64                                 `json:"talent_payment"`                // 达人垫付金额
+	IsPayPayment           int                                     `json:"is_pay_payment"`                // 企业是否返样品钱
+	IsPayReward            int                                     `json:"is_pay_reward"`                 // 企业是否结算悬赏
+	TaskMode               int                                     `json:"task_mode"`                     // 任务形式,1、2分别表示纯佣带货、悬赏任务
+	SampleMode             int                                     `json:"sample_mode"`                   // 领样形式,1-3分别表示免费领样、垫付买样、不提供样品
+	TaskStatus             int                                     `json:"task_status"`                   // 任务状态 1待选 2已选 3落选
+	TaskStage              int                                     `json:"task_stage"`                    // 任务阶段,详情见info_sec_task_stage表
+	CreateDate             *gtime.Time                             `json:"create_date"`                   // 创建时间
+	SelectDate             *gtime.Time                             `json:"select_date"`                   // 反选时间
+	DeliveryDate           *gtime.Time                             `json:"delivery_date"`                 // 发货时间
+	CompleteDate           *gtime.Time                             `json:"complete_date"`                 // 结束时间
+	WithdrawDate           *gtime.Time                             `json:"withdraw_date"`                 // 提现时间
+	CompleteStatus         int                                     `json:"complete_status"`               // 结束方式 1未结束 2正常结束 3反选失败
+	LogisticsStatus        int                                     `json:"logistics_status"`              // 发货状态 1 待发货 2已发货 3 已签收
+	AssignmentStatus       uint                                    `json:"assignment_status"`             // 作业上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	UpdateAt               *gtime.Time                             `json:"update_at"`                     // 更新时间
+	WithdrawStatus         int                                     `json:"withdraw_status"`               // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现
+	LeadTeamId             string                                  `json:"lead_team_id"`                  // 作为团长的young之团id,对应younggee_talent_team中的team_id字段
+	TeamId                 string                                  `json:"team_id"`                       // 作为团员的young之团id,对应younggee_talent_team中的team_id字段
+	TeamIncome             float64                                 `json:"team_income"`                   // young之团团长现金收益
+	TeamPoint              int                                     `json:"team_point"`                    // young之团团长积分收益
+	RewardStrategy         []*youngee_talent_model.RewardStrategy  `orm:"with:selection_id=selection_id"` // 悬赏策略表
+	SecTaskTable           *youngee_talent_model.SecTaskInfoDetail `orm:"with:task_id=task_id"`
+	SaleActual             int                                     `json:"sale_actual"` //达人带出此商品的有效销量
+	PlatformIconUrl        string                                  `json:"platform_icon_url"`
+	PlatformName           string                                  `json:"platform_name"`
+	PlatformNickName       string                                  `json:"platform_nick_name"`
+	SelectionName          string                                  `json:"selection_name"`
+	ProductPhotoSnap       string                                  `json:"product_photo_snap"`
 	//YounggeeProductPhoto   *[]model.YounggeeProductPhoto // 商品图片表
-	TaskDdl *gtime.Time `json:"task_ddl"`
+	TaskDdl   *gtime.Time `json:"task_ddl"`
+	FreeStage int         `json:"free_stage" ` // 免费领样阶段,1-5分别代表已申请、已拒绝、待发货、已发货、已收货',
+
 }
 
 type UpdateStageReq struct {
@@ -60,3 +66,10 @@ type UpdateStageReq struct {
 	TaskStage        int    `json:"task_stage"`        // 任务阶段,详情见info_sec_task_stage表
 	AssignmentStatus uint   `json:"assignment_status"` // 作业上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
 }
+
+type LogisticsDetail struct {
+	AddressSnap      string                        `json:"address_snap"`
+	LogisticsContext *youngee_talent_model.KdState `json:"logistics_context"`
+	LogisticsCompany string                        `json:"logistics_company"`
+	LogisticsNumber  string                        `json:"logistics_number"`
+}

+ 69 - 0
app/system/sectask/sectask_service.go

@@ -7,6 +7,9 @@ import (
 	"strconv"
 	"youngmini_server/app/dao"
 	"youngmini_server/app/model"
+	"youngmini_server/app/model/youngee_talent_model"
+	"youngmini_server/app/utils"
+
 	//"youngmini_server/app/model/youngee_talent_model"
 	_ "youngmini_server/app/model/youngee_talent_model"
 )
@@ -61,6 +64,7 @@ func (s *secTaskService) List(ctx context.Context, listSecTaskReq *ListSecTaskRe
 
 		// 为每个任务根据项目id查询项目名称和主图
 		for index, v := range res.SecTask {
+
 			whereCondition1 := g.Map{
 				dao.YounggeeSelectionInfo.Columns.SelectionId: v.SelectionId,
 			}
@@ -84,12 +88,31 @@ func (s *secTaskService) List(ctx context.Context, listSecTaskReq *ListSecTaskRe
 				fmt.Println(err)
 				return
 			}
+
+			// 查询RewardStrategy表数据
+			// 或者使用指针类型并初始化
+			var RewardStrategy []*youngee_talent_model.RewardStrategy
+			err = g.DB().Model(youngee_talent_model.RewardStrategy{}).WithAll().Where("selection_id", v.SelectionId).Scan(&RewardStrategy)
+			if err != nil {
+				fmt.Println("ffff")
+			}
+
+			var sectaskTable *youngee_talent_model.SecTaskInfoDetail
+			err = g.DB().Model("younggee_sec_task_info").Where("talent_id = ? AND selection_id = ? ", tid, v.SelectionId).Scan(&sectaskTable)
+			if err != nil {
+				fmt.Println(err)
+				return
+			}
+
 			res.SecTask[index].PlatformIconUrl = platformMap[strconv.Itoa(selection.Platform)].PlatformIcon
 			res.SecTask[index].PlatformName = platformMap[strconv.Itoa(selection.Platform)].PlatformName
 			res.SecTask[index].PlatformNickName = account.PlatformNickname
 			res.SecTask[index].SelectionName = selection.SelectionName
 			res.SecTask[index].ProductPhotoSnap = selection.ProductPhotoSnap
 			res.SecTask[index].TaskDdl = selection.TaskDdl
+			res.SecTask[index].RewardStrategy = RewardStrategy //悬赏策略表
+			res.SecTask[index].SecTaskTable = sectaskTable     //sectask表中全部数据
+
 			//res.SecTask[index].YounggeeProductPhoto = ProductPhoto
 			//代替商品照片快照
 			//fmt.Println("--------------res.SecTask[index]: ", res.SecTask[index])
@@ -114,3 +137,49 @@ func UpdateStageAndStatus(ctx context.Context, updateStageReq *UpdateStageReq) (
 	}
 	return
 }
+
+func (s *secTaskService) ShowLogisticsDetail(ctx context.Context, tid, taskId string) (*LogisticsDetail, error) {
+	var resp = LogisticsDetail{
+		LogisticsCompany: "",
+		LogisticsNumber:  "",
+		AddressSnap:      "",
+		LogisticsContext: nil,
+	}
+	// 校验达人id是否一致,并查询达人收货地址快照
+	talentWhereCondition := g.Map{
+		dao.YounggeeSecTaskInfo.Columns.TaskId: taskId,
+	}
+	var secTask *model.YounggeeSecTaskInfo
+	err := dao.YounggeeSecTaskInfo.Ctx(ctx).Where(talentWhereCondition).Scan(&secTask)
+	if err != nil || secTask == nil {
+		g.Log().Error("任务表查询失败")
+		return nil, err
+	}
+	if secTask.TalentId != tid {
+		g.Log().Error("用户id不一致")
+		return nil, err
+	}
+	resp.AddressSnap = secTask.TalentPostAddrSnap
+
+	// 根据任务id查询物流快递公司和快递单号
+	whereCondition := g.Map{
+		dao.YoungeeTaskLogistics.Columns.TaskId: taskId,
+	}
+	var logisticsInfo *model.YoungeeTaskLogistics
+	err = dao.YoungeeTaskLogistics.Ctx(ctx).Where(whereCondition).Scan(&logisticsInfo)
+	if err != nil || logisticsInfo == nil {
+		g.Log().Error("物流信息表查询失败")
+		return nil, err
+	}
+	resp.LogisticsCompany = logisticsInfo.CompanyName
+	resp.LogisticsNumber = logisticsInfo.LogisticsNumber
+
+	// 查询物流详细信息
+	var logisticsDetail = utils.GetKDDetails(logisticsInfo.CompanyName, logisticsInfo.LogisticsNumber)
+	if err != nil || logisticsInfo == nil {
+		g.Log().Error("调用快递100API查询失败")
+		return nil, err
+	}
+	resp.LogisticsContext = logisticsDetail
+	return &resp, nil
+}

+ 1 - 0
app/utils/GetInfoFromSession.go

@@ -19,6 +19,7 @@ type sessionTalentInfo struct {
 func (*sessionTalentInfo) GetTalentIdFromSession(r *ghttp.Request) (string, error) {
 	//在前端request1111.js中手动把token加入header中的
 	t := r.GetHeader("Token")
+	fmt.Println("Token------->", t)
 	if t == "" {
 		return "", errors.New("not found info by token")
 	}

+ 142 - 0
app/utils/kuaidi100.go

@@ -0,0 +1,142 @@
+package utils
+
+import (
+	"youngmini_server/app/model/youngee_talent_model"
+
+	"crypto/md5"
+	"encoding/hex"
+	"encoding/json"
+	"fmt"
+	"io/ioutil"
+	"net/http"
+	"net/url"
+	"strings"
+)
+
+var KD100Flags = map[string]string{
+	"圆通速递":   "yuantong",
+	"韵达快递":   "yunda",
+	"申通快递":   "shentong",
+	"中通快递":   "zhongtong",
+	"顺丰速运":   "shunfeng",
+	"极兔":     "jtexpress",
+	"邮政快递包裹": "youzhengguonei",
+	"EMS":    "ems",
+	"京东物流":   "jd",
+	"邮政标准快递": "youzhengbk",
+	"丰网速运":   "fengwang",
+	"德邦快递":   "debangkuaidi",
+	"德邦物流":   "debangwuliu",
+	"丹鸟":     "danniao",
+	"飞豹快递":   "feibaokuaidi",
+	"中通快运":   "zhongtongkuaiyun",
+	"安能快运":   "annengwuliu",
+	"百世快递":   "huitongkuaidi",
+	"安得物流":   "annto",
+	"跨越速运":   "kuayue",
+	"特急送":    "lntjs",
+	"宅急送":    "zhaijisong",
+	"其它快递":   "other",
+}
+
+// GetKDStatus 获取快递跟踪信息
+func GetKDStatus(com, num string) string {
+	fmt.Printf("查询物流公司为 %s, 快递为编号为 %v 的快递\n", KD100Flags[com], num)
+	key := "GsCwDkmq1520"                          //客户授权key
+	customer := "F2E05F275D02E5344011B3DCD6FEB80D" //查询公司编号
+
+	postUrl := "https://poll.kuaidi100.com/poll/query.do" //实时查询请求地址
+
+	paramData := make(map[string]string)
+	paramData["com"] = com //快递公司编码
+	paramData["num"] = num //快递单号
+
+	paramDataSlice, _ := json.Marshal(paramData)
+	paramjson := string(paramDataSlice)
+
+	sign := strings.ToUpper(GetMD5Encode(paramjson + key + customer))
+
+	// POST请求需要三个参数,分别为customer(CustomerId)和sign(签名)和param(参数)
+	fmt.Println("快递 sign:", sign)
+	fmt.Println("快递 paramjson:", paramjson)
+	postRes, postErr := http.PostForm(postUrl, url.Values{"customer": {customer}, "sign": {sign}, "param": {paramjson}})
+	if postErr != nil {
+		fmt.Println("查询失败" + postErr.Error())
+		return "查询失败"
+	}
+	postBody, err := ioutil.ReadAll(postRes.Body)
+	if err != nil {
+		fmt.Println("查询失败,请至快递公司官网自行查询" + err.Error())
+		return "查询失败,请至快递公司官网自行查询"
+	}
+	resp := youngee_talent_model.KdState{}
+	err = json.Unmarshal(postBody, &resp)
+	if err != nil {
+		fmt.Println("json.Unmarshal error", err.Error())
+		return "查询失败"
+	}
+	if resp.IsCheck == "1" {
+		fmt.Println("查询成功,快递已签收")
+	} else {
+		fmt.Println("查询成功,快递尚未签收")
+	}
+	return resp.IsCheck
+}
+
+func GetKDDetails(com, num string) *youngee_talent_model.KdState {
+	fmt.Printf("查询物流公司为 %s, 快递为编号为 %v 的快递\n", KD100Flags[com], num)
+	com = KD100Flags[com]
+	key := "GsCwDkmq1520"                          //客户授权key
+	customer := "F2E05F275D02E5344011B3DCD6FEB80D" //查询公司编号
+
+	postUrl := "https://poll.kuaidi100.com/poll/query.do" //实时查询请求地址
+
+	paramData := make(map[string]string)
+	paramData["com"] = com //快递公司编码
+	paramData["num"] = num //快递单号
+
+	paramDataSlice, _ := json.Marshal(paramData)
+	paramjson := string(paramDataSlice)
+
+	sign := strings.ToUpper(GetMD5Encode(paramjson + key + customer))
+
+	// POST请求需要三个参数,分别为customer(CustomerId)和sign(签名)和param(参数)
+	fmt.Println("快递 sign:", sign)
+	fmt.Println("快递 paramjson:", paramjson)
+	postRes, postErr := http.PostForm(postUrl, url.Values{"customer": {customer}, "sign": {sign}, "param": {paramjson}})
+	if postErr != nil {
+		fmt.Println("查询失败" + postErr.Error())
+		return nil
+	}
+	postBody, err := ioutil.ReadAll(postRes.Body)
+	if err != nil {
+		fmt.Println("查询失败,请至快递公司官网自行查询" + err.Error())
+		return nil
+	}
+	fmt.Printf("postBody=%+v\n", postBody)
+	resp := youngee_talent_model.KdState{}
+	err = json.Unmarshal(postBody, &resp)
+	fmt.Printf("resp=%+v\n", resp)
+	if resp.Data != nil {
+		for _, v := range resp.Data {
+			fmt.Printf("v=%+v\n", v)
+		}
+	}
+	if err != nil {
+		fmt.Println("json.Unmarshal error", err.Error())
+		return nil
+	}
+	if resp.IsCheck == "1" {
+		fmt.Println("查询成功,快递已签收")
+	} else {
+		fmt.Println("查询成功,快递尚未签收")
+	}
+	return &resp
+}
+
+// GetMD5Encode 返回一个32位md5加密后的字符串
+func GetMD5Encode(data string) string {
+	h := md5.New()
+	h.Write([]byte(data))
+	return hex.EncodeToString(h.Sum(nil))
+}

二進制
bin/main.exe


二進制
bin/v3.3.5/linux_amd64/youngmini_server


二進制
bin/main.exe~ → bin/v3.3.5/windows_amd64/youngmini_server.exe


二進制
bin/v3.3.6/linux_amd64/youngmini_server


二進制
bin/v3.3.6/windows_amd64/youngmini_server.exe


二進制
bin/v3.3.7/linux_amd64/youngmini_server


二進制
bin/v3.3.7/windows_amd64/youngmini_server.exe


二進制
bin/v3.4.1/linux_amd64/youngmini_server


二進制
bin/v3.4.1/windows_amd64/youngmini_server.exe


+ 1 - 1
config/config.toml

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

+ 7 - 0
main.go

@@ -1,6 +1,8 @@
 package main
 
 import (
+	"fmt"
+	"youngmini_server/app/utils"
 	_ "youngmini_server/boot"
 	_ "youngmini_server/router"
 
@@ -19,5 +21,10 @@ func main() {
 	adapter := adapter.NewRedis(g.Redis())
 	g.DB().GetCache().SetAdapter(adapter)
 
+	var resp = utils.GetKDDetails("圆通速递", "2163347472375261969")
+	fmt.Printf("resp=%+v\n", resp)
+	//var resp = service.ShowLogisticsDetail("2508915060")
+	//fmt.Printf("resp=%+v\n", resp)
+
 	g.Server().Run()
 }

+ 2 - 0
middleware/middleware_wx_auth.go

@@ -1,12 +1,14 @@
 package middleware
 
 import (
+	"fmt"
 	"github.com/gogf/gf/frame/g"
 	"github.com/gogf/gf/net/ghttp"
 )
 
 func WxAuth(r *ghttp.Request) {
 	token := r.Header.Get("Token")
+	fmt.Println("wxauth*******", token)
 	if !r.Session.Contains(token) {
 		r.Response.WriteJson(g.Map{
 			"code": 403,

+ 11 - 1
router/router.go

@@ -104,17 +104,25 @@ func init() {
 
 		//nignx转发含code的请求到此处
 		s.BindHandler("/kuaishouauth", func(r *ghttp.Request) {
+
 			ClientKey := "ks651333097154138217"
 			ClientSecret := "dBt0rVRhTpUqcrOYGGpv0A"
 			//SignSecret := "bf6393dce0a2b669ee348bebb837b0da"
 			code := r.GetString("code")
 			state := r.GetString("state")
+			//如果该达人(state)已经有数据了,删除。模拟在快手刷新授权 没有数据则空操作
+			_, err := g.DB().Model("platform_kuaishou_user_info").
+				Where("talent_id = ? ", state).
+				Delete()
+			if err != nil {
+				r.Response.WriteJson("platform_kuaishou_user_info delete failed")
+			}
 			//获取accesstoken
 			res_auth, _ := oauth.GetAccessToken(ClientKey, ClientSecret, code)
 			AccessToken := res_auth.AccessToken
 			//获取基本信息
 			res_info, _ := user.GetUserinfo(ClientKey, AccessToken)
-			//30天销量获取需要单独开一个接口QuerySalesFor30Days,前端调用并且传参数为订单处于30+50+60的
+			//30天销量不在扫码时获取。
 
 			err_auth := r.Response.WriteJson(res_auth)
 			err_info := r.Response.WriteJson(res_info)
@@ -136,6 +144,7 @@ func init() {
 				TalentId:     state,
 				AccessToken:  AccessToken,
 				OpenId:       res_auth.OpenId,
+				PlatformId:   4, //快手平台
 				RefreshToken: res_auth.RefreshToken,
 				HeadUri:      res_info.Data.Head,
 				NickName:     res_info.Data.Name,
@@ -179,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("/logistics/detail", sectask.SecTask.ShowLogisticsDetail)
 			})
 			group.Group("/assignment", func(group *ghttp.RouterGroup) {
 				group.GET("/list", assignment.Assignment.List)