|
@@ -70,7 +70,6 @@ func (*selectionTask) GetList(ctx context.Context, request http_model.GetSecTask
|
|
|
}
|
|
|
|
|
|
func (*selectionTask) PassCoop(ctx context.Context, request http_model.PassSecTaskCoopRequest) (*http_model.PassSecTaskCoopData, error) {
|
|
|
-
|
|
|
_, err := db.PassSecTaskCoop(ctx, request.SelectionId, request.TaskIds)
|
|
|
if err != nil {
|
|
|
logrus.WithContext(ctx).Errorf("[sectask_service service] call PassCoop error,err:%+v", err)
|
|
@@ -193,16 +192,29 @@ func (*selectionTask) Settle(ctx context.Context, entersizeId string, request ht
|
|
|
|
|
|
// 6. 创建选品收益记录
|
|
|
// 返现收益
|
|
|
+ var productPhotoStruct []gorm_model.YounggeeProductPhoto
|
|
|
+ if err = json.Unmarshal([]byte(selection.ProductPhotoSnap), &productPhotoStruct); err != nil {
|
|
|
+ fmt.Println("Error:", err)
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ var mainPhoto = ""
|
|
|
+ for _, w := range productPhotoStruct {
|
|
|
+ if w.Symbol == 1 {
|
|
|
+ mainPhoto = w.PhotoUrl
|
|
|
+ }
|
|
|
+ }
|
|
|
t := time.Now()
|
|
|
if request.IsReturnMoney == 1 {
|
|
|
income := gorm_model.YounggeeTalentIncome{
|
|
|
TalentID: secTask.TalentID,
|
|
|
SelectionID: secTask.SelectionID,
|
|
|
SectaskID: secTask.TaskID,
|
|
|
+ Type: 2,
|
|
|
BrandName: product.BrandName,
|
|
|
TaskName: selection.SelectionName,
|
|
|
+ PhotoUrl: mainPhoto,
|
|
|
Income: strconv.FormatFloat(returnMoney, 'f', 10, 32),
|
|
|
- IncomeType: 1,
|
|
|
+ IncomeType: 3,
|
|
|
WithdrawStatus: 1,
|
|
|
IncomeAt: &t,
|
|
|
WithdrawAt: nil,
|
|
@@ -219,10 +231,12 @@ func (*selectionTask) Settle(ctx context.Context, entersizeId string, request ht
|
|
|
TalentID: secTask.TalentID,
|
|
|
SelectionID: secTask.SelectionID,
|
|
|
SectaskID: secTask.TaskID,
|
|
|
+ Type: 2,
|
|
|
BrandName: product.BrandName,
|
|
|
TaskName: selection.SelectionName,
|
|
|
+ PhotoUrl: mainPhoto,
|
|
|
Income: strconv.FormatFloat(rewardMoney, 'f', 10, 32),
|
|
|
- IncomeType: 1,
|
|
|
+ IncomeType: 4,
|
|
|
WithdrawStatus: 1,
|
|
|
IncomeAt: &t,
|
|
|
WithdrawAt: nil,
|