Browse Source

update

tmp
DengBiao 7 months ago
parent
commit
400e2ce594
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      app/admin/svc/svc_data_statisstics.go

+ 7
- 1
app/admin/svc/svc_data_statisstics.go View File

@@ -391,7 +391,8 @@ func SelfSupportForSchoolDataStatisticsExport(req md.SelfSupportForSchoolDataSta
} }


var m []*db.SelfSupportForSchoolOrdWithUserIdentityV2 var m []*db.SelfSupportForSchoolOrdWithUserIdentityV2
sess := db.Db.Desc("self_support_for_school_ord.id").Where("self_support_for_school_ord.order_status =?", enum.SelfSupportForSchoolOrdOrderStatusForSuccess)
eg := db.Db
sess := eg.Desc("self_support_for_school_ord.id").Where("self_support_for_school_ord.order_status =?", enum.SelfSupportForSchoolOrdOrderStatusForSuccess)
if req.EnterpriseId != 0 { if req.EnterpriseId != 0 {
sess.And("self_support_for_school_ord.enterprise_id =?", req.EnterpriseId) sess.And("self_support_for_school_ord.enterprise_id =?", req.EnterpriseId)
} }
@@ -417,7 +418,12 @@ func SelfSupportForSchoolDataStatisticsExport(req md.SelfSupportForSchoolDataSta
var data = map[string]map[string]map[string]map[string]map[string]float64{} var data = map[string]map[string]map[string]map[string]map[string]float64{}
for _, vv := range m { for _, vv := range m {
device := deviceListMapping[vv.SelfSupportForSchoolOrd.DeviceSn] device := deviceListMapping[vv.SelfSupportForSchoolOrd.DeviceSn]
ordCreateAt, _ := time.ParseInLocation("2006-01-02 15:04:05", vv.SelfSupportForSchoolOrd.CreateAt, time.Local)
merchantCreateAt, _ := time.ParseInLocation("2006-01-02 15:04:05", merchantListMapping[device.MerchantId].CreateAt, time.Local)
shopName := merchantListMapping[device.MerchantId].Name shopName := merchantListMapping[device.MerchantId].Name
if ordCreateAt.Before(merchantCreateAt) {
shopName = "设备已更换商户"
}
deviceName := device.Name deviceName := device.Name
if data[vv.Enterprise.Name] == nil { if data[vv.Enterprise.Name] == nil {
data[vv.Enterprise.Name] = make(map[string]map[string]map[string]map[string]float64) data[vv.Enterprise.Name] = make(map[string]map[string]map[string]map[string]float64)


Loading…
Cancel
Save