This commit is contained in:
苏尹岚
2021-03-10 10:10:55 +08:00
parent 89d722c729
commit 493f2ba97b
5 changed files with 37 additions and 9 deletions

View File

@@ -348,9 +348,6 @@ func Init() {
jdsCookie = configs[0].Value
api.JdShopAPI.SetCookieWithStr(jdsCookie)
}
// if configs, err := dao.QueryConfigs(dao.GetDB(), "jdsCookie2", model.ConfigTypeCookie, ""); err == nil {
// api.JdShop2API.SetCookieWithStr(configs[0].Value)
// }
if configs, err := dao.QueryConfigs(dao.GetDB(), "yinbaoCookie", model.ConfigTypeCookie, ""); err == nil {
yinbaoCookie := configs[0].Value
api.YinBaoAPI.SetCookie(".POSPALAUTH30220", yinbaoCookie)

View File

@@ -403,6 +403,7 @@ type GetStoreManageStateResult struct {
ActAmple int `json:"actAmple"` //活动丰富的
NullOrderCount int `json:"nullOrderCount"` //无效订单数
RefuseOrderCount int `json:"refuseOrderCount"` //拒绝订单数
StoreScore int `json:"storeScore"` //门店评分
RepurchaseRate int `json:"repurchaseRate"` //复购率(转化率)
}
@@ -468,12 +469,27 @@ func GetStoreManageState(ctx *jxcontext.Context, storeIDs []int, vendorID int, f
}
}
}
result.SkuCount = skuCount
result.HighSkuCount = highSkuCount
result.SkuCount, result.HighSkuCount = skuCount, highSkuCount
//活动丰富度
handler := partner.GetPurchasePlatformFromVendorID(vendorID)
ample, _ := handler.GetActAmple(ctx, storeDetail.VendorStoreID, storeDetail.VendorStoreID)
result.ActAmple = ample
//订单
nullOrderCount, refuseOrderCount := 0, 0
if orderList, err := dao.QueryOrders(db, "", 0, []int{vendorID}, v, fromTimeT, toTimeT); err == nil {
for _, v := range orderList {
if v.Status == model.OrderStatusCanceled {
nullOrderCount++
}
if waybills, err2 := dao.GetWayBillByOrderID(db, 0, vendorID, 0, v.VendorOrderID); err2 == nil {
if len(waybills) > 0 {
refuseOrderCount++
}
}
}
}
result.NullOrderCount, result.RefuseOrderCount = nullOrderCount, refuseOrderCount
//转化率
getStoreManageStateResult = append(getStoreManageStateResult, result)
}
return getStoreManageStateResult, err