|
@@ -124,7 +124,7 @@ func after(productType int, dataLen int, userProduct *model.UserProduct, statusC
|
|
|
orderAfter := userProduct.LeftNum - dataLen
|
|
|
nowStr := time.Now().Local().Format("2006-01-02 15:04:05")
|
|
|
//扣费
|
|
|
- err := tx.Exec("update user_product set left_num = IF(`left_num`<1, 0, `left_num`-?),update_at = ? WHERE `app_id` = ? and product_id=?", nowStr, dataLen, appID, productID).Error
|
|
|
+ err := tx.Exec("update user_product set left_num = IF(`left_num`<1, 0, `left_num`-?),update_at = ? WHERE `app_id` = ? and product_id=?", dataLen, nowStr, appID, productID).Error
|
|
|
if err != nil {
|
|
|
log.Printf("appID:[%s],productID:[%d] execute cost money error:[%v]", appID, productID, err)
|
|
|
tx.Rollback()
|