package balance_service import ( "time" "github.com/ouxuanserver/osmanthuswine/src/core" ) func IncrUserBalance(id int, balance float64) (int, error) { res, err := core.GetXormAuto().Exec("update ox_user set balance=balance+?, updated_at=? "+ "where id=? and ox_user.is_delete=0", balance, time.Now(), id) if err != nil { return 0, err } return res.RowsAffected() } func IncrRewardBalance(cid int, balance float64) (int, error) { res, err := core.GetXormAuto().Exec("update ox_reward_wallet set balance=balance+?, updated_at=? "+ "where customer_id=? and is_delete=0", balance, time.Now(), cid) if err != nil { return 0, err } return res.RowsAffected() } func IncrBullyScreenBalance(cid int, balance float64) (int, error) { res, err := core.GetXormAuto().Exec("update ox_bully_screen_wallet set balance=balance+?, update_at=? "+ "Where customer_id=? and is_delete=0", balance, time.Now(), cid) if err != nil { return 0, err } return res.RowsAffected() }