|
@@ -151,11 +151,15 @@ func ConfirmWithdrawal(ctx context.Context, withdrawId string) error {
|
|
|
db = db.Debug().Model(gorm_model.YounggeeWithdrawRecord{}).Where("withdraw_id = ?", withdrawId).Find(&withdrawInfo)
|
|
|
db2.Debug().Where("withdraw_id = ?", withdrawId).Updates(gorm_model.YounggeeWithdrawRecord{Status: 2, WithdrawAt: time.Now()})
|
|
|
taskIdLists := strings.Split(withdrawInfo.TaskIDList, ",")
|
|
|
- for _, taskIdList := range taskIdLists {
|
|
|
+ for _, taskId := range taskIdLists {
|
|
|
db1 := GetReadDB(ctx)
|
|
|
- db1.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskIdList).Updates(gorm_model.YoungeeTaskInfo{WithdrawStatus: 4})
|
|
|
+ err := db1.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(gorm_model.YoungeeTaskInfo{WithdrawStatus: 4}).Error
|
|
|
+ if err != nil {
|
|
|
+ logrus.WithContext(ctx).Errorf("[finance db] Update YoungeeTaskInfo error,err:%+v", err)
|
|
|
+ return err
|
|
|
+ }
|
|
|
|
|
|
- err := CreateMessageByTaskId(ctx, 6, 1, taskIdList)
|
|
|
+ err = CreateMessageByTaskId(ctx, 6, 1, taskId)
|
|
|
if err != nil {
|
|
|
logrus.WithContext(ctx).Errorf("[ConfirmWithdrawal] call CreateMessageByTaskId error,err:%+v", err)
|
|
|
return err
|