dengbiao 7 miesięcy temu
rodzic
commit
8b8ec6404b
3 zmienionych plików z 47 dodań i 2 usunięć
  1. +17
    -1
      app/admin/hdl/hdl_demo.go
  2. +29
    -1
      app/customer/hdl/hdl_self_support_for_school_order.go
  3. +1
    -0
      app/router/admin_router.go

+ 17
- 1
app/admin/hdl/hdl_demo.go Wyświetl plik

@@ -22,8 +22,24 @@ import (

// Demo 测试
func Demo(c *gin.Context) {
var m []model.CentralKitchenForSchoolUserWithDay
eg := db.Db
var mm []model.UserIdentity
if err1 := eg.Where("state = 1").Asc("id").Find(&mm); err1 != nil {
e.OutErr(c, e.ERR, err1.Error())
return
}
for _, v := range mm {
var m []model.CentralKitchenForSchoolUserWithDay
if err1 := eg.Where("identity_id = ?", v.Id).And("state =1 and enterprise_id !=?", v.EnterpriseId).Find(&m); err1 != nil {
e.OutErr(c, e.ERR, err1.Error())
return
}
if len(m) > 0 {
utils.FilePutContents("demo_demo", utils.SerializeStr(v))
}
}
return
var m []model.CentralKitchenForSchoolUserWithDay
if err1 := eg.Where("state = 3").Asc("id").Find(&m); err1 != nil {
e.OutErr(c, e.ERR, err1.Error())
return


+ 29
- 1
app/customer/hdl/hdl_self_support_for_school_order.go Wyświetl plik

@@ -6,8 +6,10 @@ import (
svc2 "applet/app/customer/svc"
svc "applet/app/customer/svc/order"
"applet/app/db"
"applet/app/db/model"
"applet/app/e"
"applet/app/enum"
"applet/app/utils"
"github.com/gin-gonic/gin"
)

@@ -25,13 +27,39 @@ func SelfSupportForSchoolOrderList(c *gin.Context) {
e.OutErr(c, e.ERR, err.Error())
return
}

tradeAmountTotal, err := svc.SupportOrderStatistic(req)
if err != nil {
e.OutErr(c, e.ERR, err.Error())
return
}

var deviceList []*model.Device
err = db.Db.Where("1 = 1").Find(&deviceList)
if err != nil {
e.OutErr(c, e.ERR, err.Error())
return
}
var merchantList []*model.Merchant
err = db.Db.Where("1 = 1").Find(&merchantList)
if err != nil {
e.OutErr(c, e.ERR, err.Error())
return
}
var merchantListMapping = map[int]model.Merchant{}
for _, v := range merchantList {
merchantListMapping[v.Id] = *v
}
var merchantWithDeviceListMapping = map[string]model.Merchant{}
for _, v := range deviceList {
merchantWithDeviceListMapping[v.DeviceSn] = merchantListMapping[v.MerchantId]
}

for _, v := range list {
v.MerchantName = merchantWithDeviceListMapping[v.DeviceSn].Name
}

utils.FilePutContents("SelfSupportForSchoolOrderList", utils.SerializeStr(list))

e.OutSuc(c, map[string]interface{}{
"list": list,
"total": total,


+ 1
- 0
app/router/admin_router.go Wyświetl plik

@@ -236,6 +236,7 @@ func rEnterpriseManage(r *gin.RouterGroup) {
r.POST("/selfSupportForSchool/importTeacher", hdl.SelfSupportForSchoolImportTeacher) //"自营-学校"导入老师
r.GET("/selfSupportForSchool/downloadTemplateExcel", hdl.SelfSupportForSchoolDownloadTemplateExcel) //"自营-学校"下载表格模板
r.POST("/selfSupportForSchool/ordList", hdl.SelfSupportForSchoolOrdList) //"自营-学校"订单列表
r.POST("/selfSupportForSchool/ordRefund", hdl.SelfSupportForSchoolOrdRefund) //财务管理-(自营-学校)订单退款
r.Any("/selfSupportForSchool/ordListExport", hdl.SelfSupportForSchoolOrdListExport) //"自营-学校"订单列表-导出
r.POST("/selfSupportForSchool/consumeLimit", hdl.SelfSupportForSchoolConsumeLimit) //"自营-学校"消费限制-编辑
r.POST("/selfSupportForSchool/consumeLimitList", hdl.SelfSupportForSchoolConsumeLimitList) //"自营-学校"消费限制-列表


Ładowanie…
Anuluj
Zapisz