order_admin.go 487 B

1234567891011121314151617
  1. package dao
  2. import (
  3. "go-common/app/admin/ep/melloi/model"
  4. )
  5. // QueryOrderAdmin get administrator for Order of this project
  6. func (d *Dao) QueryOrderAdmin(userName string) (admin *model.OrderAdmin, err error) {
  7. admin = &model.OrderAdmin{}
  8. err = d.DB.Table(model.OrderAdmin{}.TableName()).Where("user_name = ?", userName).First(admin).Error
  9. return
  10. }
  11. // AddOrderAdmin add order of admin
  12. func (d *Dao) AddOrderAdmin(admin *model.OrderAdmin) error {
  13. return d.DB.Create(admin).Error
  14. }