面包店
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.

dbs_plan_commission.go 586 B

9 kuukautta sitten
123456789101112131415161718192021222324252627282930
  1. package db
  2. import (
  3. "xorm.io/xorm"
  4. "applet/app/db/model"
  5. "applet/app/utils/logx"
  6. )
  7. func DbsPlanCommissionById(eg *xorm.Engine, id int) (*model.PlanCommission, error) {
  8. var m model.PlanCommission
  9. if isGet, err := eg.Where("id = ?", id).Get(&m); err != nil || !isGet {
  10. return nil, logx.Warn(err)
  11. }
  12. return &m, nil
  13. }
  14. func DbsPlanCommissionByIds(eg *xorm.Engine, ids ...int) []*model.PlanCommission {
  15. var m []*model.PlanCommission
  16. var err error
  17. if len(ids) > 0 {
  18. err = eg.In("id", ids).Find(&m)
  19. } else {
  20. err = eg.Find(&m)
  21. }
  22. if err != nil {
  23. return nil
  24. }
  25. return m
  26. }