aa
This commit is contained in:
@@ -460,7 +460,6 @@ func GetStoreManageState(ctx *jxcontext.Context, storeIDs []int, vendorID int, f
|
||||
MarketScale: storeDetail.MarketScale,
|
||||
CoverArea: storeDetail.CoverArea,
|
||||
}
|
||||
fmt.Println("11111111111111111111111111")
|
||||
//覆盖范围
|
||||
if result.CoverArea == 0 {
|
||||
handler := partner.GetPurchasePlatformFromVendorID(vendorID)
|
||||
@@ -476,14 +475,12 @@ func GetStoreManageState(ctx *jxcontext.Context, storeIDs []int, vendorID int, f
|
||||
}
|
||||
}
|
||||
}
|
||||
fmt.Println("22222222222222222222222222222222222")
|
||||
//营业时长
|
||||
optime := jxutils.JxOperationTime2TimeByDate(storeDetail.CloseTime1, time.Now()).Sub(jxutils.JxOperationTime2TimeByDate(storeDetail.OpenTime1, time.Now())).Hours()
|
||||
if storeDetail.CloseTime2 != 0 && storeDetail.OpenTime2 != 0 {
|
||||
optime += jxutils.JxOperationTime2TimeByDate(storeDetail.CloseTime2, time.Now()).Sub(jxutils.JxOperationTime2TimeByDate(storeDetail.OpenTime2, time.Now())).Hours()
|
||||
}
|
||||
result.OpenTime = optime * float64(dayCount)
|
||||
fmt.Println("33333333333333333333333333333333333")
|
||||
//商品数
|
||||
highSkuCount := 0
|
||||
storeSkus, _ := dao.GetStoresSkusForManageState(db, v, model.StoreSkuBindStatusNormal)
|
||||
@@ -493,12 +490,10 @@ func GetStoreManageState(ctx *jxcontext.Context, storeIDs []int, vendorID int, f
|
||||
}
|
||||
}
|
||||
result.SkuCount, result.HighSkuCount = len(storeSkus), highSkuCount
|
||||
fmt.Println("444444444444444444444444444444444")
|
||||
//活动丰富度
|
||||
handler := partner.GetPurchasePlatformFromVendorID(vendorID)
|
||||
ample, _ := handler.GetActAmple(ctx, storeDetail.VendorStoreID, storeDetail.VendorStoreID)
|
||||
result.ActAmple = ample
|
||||
fmt.Println("55555555555555555555555555555555555")
|
||||
//订单
|
||||
refuseOrderCount := 0
|
||||
orderList, _ := dao.QueryOrdersForManageState(db, v, vendorID, model.OrderStatusCanceled, fromTimeT, toTimeT)
|
||||
@@ -508,7 +503,6 @@ func GetStoreManageState(ctx *jxcontext.Context, storeIDs []int, vendorID int, f
|
||||
}
|
||||
}
|
||||
result.NullOrderCount, result.RefuseOrderCount = len(orderList), refuseOrderCount
|
||||
fmt.Println("666666666666666666666666666666")
|
||||
//评分(美团)
|
||||
if vendorID == model.VendorIDMTWM {
|
||||
mtapi := partner.CurAPIManager.GetAPI(model.VendorIDMTWM, storeDetail.VendorOrgCode).(*mtwmapi.API)
|
||||
@@ -555,6 +549,9 @@ func CalculateCoverArea(coordinate []string, vendorID int) (area float64) {
|
||||
xyList = append(xyList, xys)
|
||||
}
|
||||
var sum float64 = 0
|
||||
if len(xyList) == 0 {
|
||||
return 0
|
||||
}
|
||||
for i := 0; i < len(xyList)-1; i++ {
|
||||
// sum += (xyList[i+1][0] - xyList[i][0]) * (xyList[i+1][1] + xyList[i][1])
|
||||
sum += (xyList[i][0]*xyList[i+1][1] - xyList[i+1][0]*xyList[i][1])
|
||||
|
||||
Reference in New Issue
Block a user