You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
587 B

  1. package couponusers
  2. import (
  3. "CouponBackendGo/internal/dao"
  4. "CouponBackendGo/internal/service"
  5. "context"
  6. "errors"
  7. "github.com/gogf/gf/v2/frame/g"
  8. )
  9. type sCouponUsers struct{}
  10. func init() {
  11. service.RegisterCouponUsers(&sCouponUsers{})
  12. }
  13. // 添加用户选择武器记录
  14. func (s *sCouponUsers) AddRecord(ctx context.Context, jwcode int, id int, name string) (err error) {
  15. _, err = dao.CouponUsers.Ctx(ctx).Data(g.Map{
  16. "record": name,
  17. }).Where("jwcode = ? and coupon_id = ?", jwcode, id).Update()
  18. if err != nil {
  19. return errors.New("添加武器记录失败")
  20. }
  21. return
  22. }