user_merchant_api_order_info.go 558 B

12345678910111213141516171819202122232425
  1. package user_merchant
  2. import (
  3. "context"
  4. "gd_management/apis"
  5. "gd_management/errors"
  6. "github.com/astaxie/beego/orm"
  7. )
  8. func MangementGetApiOrderInfo(ctx context.Context, req *apis.MangementGetApiOrderInfoReq, reply *apis.MangementGetApiOrderInfoReply) (err error) {
  9. if req.OrderId == 0 {
  10. return errors.ArgsError
  11. }
  12. err = orm.NewOrm().QueryTable("t_gd_data_api_order").Filter("id", req.OrderId).One(&reply.OrderInfo)
  13. if err != nil {
  14. if err == orm.ErrNoRows {
  15. return errors.ApiOrderNotExist
  16. }
  17. return errors.DataBaseError
  18. }
  19. return nil
  20. }