diff --git a/business/jxcallback/orderman/orderman_ext.go b/business/jxcallback/orderman/orderman_ext.go index 200bb6f85..78f2c2275 100644 --- a/business/jxcallback/orderman/orderman_ext.go +++ b/business/jxcallback/orderman/orderman_ext.go @@ -388,13 +388,23 @@ func (c *OrderManager) GetOrders(ctx *jxcontext.Context, isIncludeFake bool, fro } } } - //if isJxIncomeArea { - // var order2 *model.GoodsOrderExt - // if order.JxIncome >= begin && order.JxIncome <= end { - // order2 = order - // return []*model.GoodsOrderExt{order2}, err - // } - //} + count := &struct { + Count int + }{} + sql2 := ` + SELECT COUNT(*) count + FROM goods_order WHERE IF(store_id = 0, jx_store_id ,store_id) = ? + ` + storeID := 0 + if order.StoreID == 0 { + storeID = order.JxStoreID + } else { + storeID = order.StoreID + } + sqlParams2 := []interface{}{storeID} + if err = dao.GetRow(db, &count, sql2, sqlParams2); err == nil { + order.StoreDayOrderCount = count.Count + } return retVal, err }, orders) tasksch.HandleTask(task, nil, true).Run() diff --git a/business/model/api.go b/business/model/api.go index 424443541..729167b70 100644 --- a/business/model/api.go +++ b/business/model/api.go @@ -41,15 +41,16 @@ type GoodsOrderExt struct { VendorPayPercentage int `json:"vendorPayPercentage"` OldPayPercentage int `json:"oldPayPercentage"` - SkuInfo string `json:"skuInfo,omitempty"` - SkuInfo2 string `json:"skuInfo2,omitempty"` - ShortSkuInfo `json:"-"` - SkuList []*ShortSkuInfo `json:"skuList,omitempty"` - Count int `json:"count"` - ShopSumPrice int64 `json:"shopSumPrice"` - AvgPrice int64 `json:"avgPrice"` - BadCommentCount int `json:"badCommentCount"` - JxIncome int64 `json:"jxIncome"` //预计收益 + SkuInfo string `json:"skuInfo,omitempty"` + SkuInfo2 string `json:"skuInfo2,omitempty"` + ShortSkuInfo `json:"-"` + SkuList []*ShortSkuInfo `json:"skuList,omitempty"` + Count int `json:"count"` + ShopSumPrice int64 `json:"shopSumPrice"` + AvgPrice int64 `json:"avgPrice"` + BadCommentCount int `json:"badCommentCount"` + JxIncome int64 `json:"jxIncome"` //预计收益 + StoreDayOrderCount int `json:"storeDayOrderCount"` //门店当天单量 FloatLng float64 `json:"floatLng"` FloatLat float64 `json:"floatLat"`