|
@@ -111,12 +111,21 @@ func (p *projectPay) SpecialSettlePay(ctx *gin.Context, req *http_model.SpecialS
|
|
|
if balance < realPay {
|
|
|
return errors.New("余额不足")
|
|
|
}
|
|
|
+
|
|
|
+ err = tx.Model(&gorm_model.ProjectInfo{}).Where("project_id = ?", req.ProjectID).
|
|
|
+ Updates(map[string]interface{}{"payment_amount": gorm.Expr("payment_amount + ?", req.Amount)}).Error
|
|
|
+ if err != nil {
|
|
|
+ logrus.WithContext(ctx).Errorf("[projectPay service] call SpecialSettlePay error,err:%+v", err)
|
|
|
+ return err
|
|
|
+ }
|
|
|
+
|
|
|
err = tx.Model(&gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", req.TaskId).Updates(gorm_model.YoungeeTaskInfo{
|
|
|
- TaskReward: req.Amount,
|
|
|
- SettleAmount: req.Amount,
|
|
|
- AllPayment: req.Amount,
|
|
|
- RealPayment: req.Amount,
|
|
|
- SettleStatus: 2,
|
|
|
+ TaskReward: req.Amount,
|
|
|
+ SettleAmount: req.Amount,
|
|
|
+ AllPayment: req.Amount,
|
|
|
+ RealPayment: req.Amount,
|
|
|
+ SettleStatus: 2,
|
|
|
+ WithdrawStatus: 2,
|
|
|
}).Error
|
|
|
if err != nil {
|
|
|
logrus.WithContext(ctx).Errorf("[projectPay service] call SpecialSettlePay error,err:%+v", err)
|