|
@@ -53,12 +53,13 @@ func (*selection) Create(ctx context.Context, request http_model.CreateSelection
|
|
|
newSelection := gorm_model.YounggeeSelectionInfo{
|
|
|
SelectionID: selectionId,
|
|
|
SelectionName: selectionName,
|
|
|
+ SelectionStatus: 1,
|
|
|
ProductID: conv.MustInt(request.ProductId, 0),
|
|
|
EnterpriseID: enterpriseId,
|
|
|
Platform: conv.MustInt(request.Platform, 0),
|
|
|
ProductSnap: string(productInfoToJson),
|
|
|
ProductPhotoSnap: string(productPhotosToJson),
|
|
|
- CreatedAt: time.Date(2026, 1, 1, 0, 0, 0, 0, time.UTC),
|
|
|
+ CreatedAt: time.Now(),
|
|
|
SubmitAt: time.Date(2026, 1, 1, 0, 0, 0, 0, time.UTC),
|
|
|
PassAt: time.Date(2026, 1, 1, 0, 0, 0, 0, time.UTC),
|
|
|
PayAt: time.Date(2026, 1, 1, 0, 0, 0, 0, time.UTC),
|
|
@@ -126,6 +127,8 @@ func (*selection) Update(ctx context.Context, request http_model.UpdateSelection
|
|
|
SampleNum: conv.MustInt(request.SampleNum, 0),
|
|
|
RemainNum: conv.MustInt(request.SampleNum, 0),
|
|
|
CommissionRate: conv.MustInt(request.CommissionRate, 0),
|
|
|
+ TaskReward: conv.MustString(request.TaskReward, "0"),
|
|
|
+ SettlementAmount: conv.MustString(request.SettlementAmount, "0"),
|
|
|
EstimatedCost: estimatedCostToString,
|
|
|
SampleCondition: request.SampleCondition,
|
|
|
RewardCondition: request.RewardCondition,
|
|
@@ -138,9 +141,10 @@ func (*selection) Update(ctx context.Context, request http_model.UpdateSelection
|
|
|
SubmitAt: time.Now(),
|
|
|
}
|
|
|
// 合并传入参数和数据表中原记录,若传入参数字段值为空,则将字段赋值为原记录中值
|
|
|
- result := util.MergeStructValue(&updateSelection, &selectionInfo)
|
|
|
+ //fmt.Printf("MergeTest %+v %+v", updateSelection, selectionInfo)
|
|
|
+ result := util.MergeStructValue(&updateSelection, selectionInfo)
|
|
|
// 利用反射机制将interface类型转换为结构体类型
|
|
|
- v := reflect.ValueOf(result).Elem()
|
|
|
+ v := reflect.ValueOf(&result).Elem()
|
|
|
if v.Kind() == reflect.Struct {
|
|
|
updateSelection = v.Interface().(gorm_model.YounggeeSelectionInfo)
|
|
|
//fmt.Println(p)
|