Browse Source

update

add_mode
DengBiao 1 year ago
parent
commit
c127296def
4 changed files with 45 additions and 18 deletions
  1. +3
    -0
      app/customer/hdl/hdl_user.go
  2. +10
    -9
      app/customer/md/md_order.go
  3. +19
    -9
      app/customer/svc/order/svc_central_kitchen_for_school_order.go
  4. +13
    -0
      app/db/db_user_identity.go

+ 3
- 0
app/customer/hdl/hdl_user.go View File

@@ -63,6 +63,9 @@ func UserInfo(c *gin.Context) {
} }
tmp["month_statistic"] = monthStatistic tmp["month_statistic"] = monthStatistic
tmp["day_statistic"] = dayStatistic tmp["day_statistic"] = dayStatistic

//判断是否存在欠费
} }


if v.UserIdentity.Identity == enum.UserIdentityForSelfSupportForWorker { if v.UserIdentity.Identity == enum.UserIdentityForSelfSupportForWorker {


+ 10
- 9
app/customer/md/md_order.go View File

@@ -22,15 +22,16 @@ type CentralKitchenForSchoolOrderRefundListReq struct {
} }


type CentralKitchenForSchoolOrderRefundListResp struct { type CentralKitchenForSchoolOrderRefundListResp struct {
OutTradeNo string `json:"out_trade_no" label:"订单号"`
OutRequestNo string `json:"out_request_no" label:"退款请求号"`
Kind int `json:"kind" label:"预定类型"`
CreateAt string `json:"create_at" label:"申请时间"`
RefundDate string `json:"refund_date" label:"退款时间"`
Date string `json:"date" label:"预定时间"`
State int `json:"state" label:"退款状态"`
Memo string `json:"memo" label:"备注"`
Amount string `json:"amount" label:"退款金额"`
OutTradeNo string `json:"out_trade_no" label:"订单号"`
OutRequestNo string `json:"out_request_no" label:"退款请求号"`
Kind int `json:"kind" label:"预定类型"`
CreateAt string `json:"create_at" label:"申请时间"`
RefundDate string `json:"refund_date" label:"退款时间"`
Date string `json:"date" label:"预定时间"`
State int `json:"state" label:"退款状态"`
Memo string `json:"memo" label:"备注"`
Amount string `json:"amount" label:"退款金额"`
EnterpriseName string `json:"enterprise_name" label:"学校名称"`
} }


type CentralKitchenForSchoolMyReserveResp struct { type CentralKitchenForSchoolMyReserveResp struct {


+ 19
- 9
app/customer/svc/order/svc_central_kitchen_for_school_order.go View File

@@ -114,24 +114,34 @@ func CentralKitchenForSchoolOrderRefund(req md.CentralKitchenForSchoolOrderRefun
func CentralKitchenForSchoolOrderRefundList(req md.CentralKitchenForSchoolOrderRefundListReq) (resp []md.CentralKitchenForSchoolOrderRefundListResp, total int64, err error) { func CentralKitchenForSchoolOrderRefundList(req md.CentralKitchenForSchoolOrderRefundListReq) (resp []md.CentralKitchenForSchoolOrderRefundListResp, total int64, err error) {
var m []*db.CentralKitchenForSchoolUserRefundDayWithCentralKitchenForSchoolUserWithDay var m []*db.CentralKitchenForSchoolUserRefundDayWithCentralKitchenForSchoolUserWithDay
sess := db.Db.Where("central_kitchen_for_school_user_refund_day.identity_id =?", req.UserIdentityId) sess := db.Db.Where("central_kitchen_for_school_user_refund_day.identity_id =?", req.UserIdentityId)
if req.State != 0 {
sess = sess.And("central_kitchen_for_school_user_refund_day.state = ?", req.State)
}
total, err = sess.Desc("central_kitchen_for_school_user_refund_day.id"). total, err = sess.Desc("central_kitchen_for_school_user_refund_day.id").
Join("LEFT", "central_kitchen_for_school_user_with_day", "central_kitchen_for_school_user_refund_day.records_id = central_kitchen_for_school_user_with_day.id"). Join("LEFT", "central_kitchen_for_school_user_with_day", "central_kitchen_for_school_user_refund_day.records_id = central_kitchen_for_school_user_with_day.id").
Limit(req.Limit, (req.Page-1)*req.Limit).FindAndCount(&m) Limit(req.Limit, (req.Page-1)*req.Limit).FindAndCount(&m)
if err != nil { if err != nil {
return nil, 0, err return nil, 0, err
} }
userIdentityDb := db.UserIdentityDb{}
userIdentityDb.Set(req.UserIdentityId)
identity, err := userIdentityDb.UserIdentity(req.UserIdentityId)
if err != nil {
return nil, 0, err
}


for _, v := range m { for _, v := range m {
resp = append(resp, md.CentralKitchenForSchoolOrderRefundListResp{ resp = append(resp, md.CentralKitchenForSchoolOrderRefundListResp{
OutTradeNo: v.CentralKitchenForSchoolUserRefundDay.OutTradeNo,
OutRequestNo: v.CentralKitchenForSchoolUserRefundDay.OutRequestNo,
Kind: v.CentralKitchenForSchoolUserWithDay.Kind,
CreateAt: v.CentralKitchenForSchoolUserRefundDay.CreateAt,
RefundDate: v.CentralKitchenForSchoolUserRefundDay.RefundDate,
Date: v.CentralKitchenForSchoolUserWithDay.Date,
State: v.CentralKitchenForSchoolUserRefundDay.State,
Memo: v.CentralKitchenForSchoolUserRefundDay.Memo,
Amount: v.CentralKitchenForSchoolUserRefundDay.Amount,
OutTradeNo: v.CentralKitchenForSchoolUserRefundDay.OutTradeNo,
OutRequestNo: v.CentralKitchenForSchoolUserRefundDay.OutRequestNo,
Kind: v.CentralKitchenForSchoolUserWithDay.Kind,
CreateAt: v.CentralKitchenForSchoolUserRefundDay.CreateAt,
RefundDate: v.CentralKitchenForSchoolUserRefundDay.RefundDate,
Date: v.CentralKitchenForSchoolUserWithDay.Date,
State: v.CentralKitchenForSchoolUserRefundDay.State,
Memo: v.CentralKitchenForSchoolUserRefundDay.Memo,
Amount: v.CentralKitchenForSchoolUserRefundDay.Amount,
EnterpriseName: identity.Enterprise.Name,
}) })
} }
return return


+ 13
- 0
app/db/db_user_identity.go View File

@@ -53,6 +53,19 @@ func (userIdentityDb *UserIdentityDb) FindUserIdentity() (*[]UserIdentityWithEnt
return &m, nil return &m, nil
} }


func (userIdentityDb *UserIdentityDb) UserIdentity(id int) (m *UserIdentityWithEnterprise, err error) {
m = new(UserIdentityWithEnterprise)
has, err := userIdentityDb.Db.Join("LEFT", "enterprise", "user_identity.enterprise_id = enterprise.id").
And("user_identity.id =?", id).Desc("user_identity.id").Get(m)
if err != nil {
return nil, logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

func (userIdentityDb *UserIdentityDb) UserIdentityInsert(m *model.UserIdentity) (int, error) { func (userIdentityDb *UserIdentityDb) UserIdentityInsert(m *model.UserIdentity) (int, error) {
_, err := userIdentityDb.Db.InsertOne(m) _, err := userIdentityDb.Db.InsertOne(m)
if err != nil { if err != nil {


Loading…
Cancel
Save