This commit is contained in:
suyl
2021-08-23 11:04:41 +08:00
parent b75bd3e39a
commit 547524cfb9

View File

@@ -388,24 +388,24 @@ func (c *OrderManager) GetOrders(ctx *jxcontext.Context, isIncludeFake bool, fro
} }
} }
} }
count := &struct { //count := &struct {
Count int // Count int
}{} //}{}
sql2 := ` //sql2 := `
SELECT COUNT(*) count // SELECT COUNT(*) count
FROM goods_order WHERE IF(store_id = 0, jx_store_id ,store_id) = ? // FROM goods_order WHERE IF(store_id = 0, jx_store_id ,store_id) = ?
WHERE order_created_at > ? AND order_created_at < ? // WHERE order_created_at > ? AND order_created_at < ?
` //`
storeID := 0 //storeID := 0
if order.StoreID == 0 { //if order.StoreID == 0 {
storeID = order.JxStoreID // storeID = order.JxStoreID
} else { //} else {
storeID = order.StoreID // storeID = order.StoreID
} //}
sqlParams2 := []interface{}{storeID, time.Now().Format("2006-01-02 00:00:00"), time.Now().Format("2006-01-02 23:59:59")} //sqlParams2 := []interface{}{storeID, time.Now().Format("2006-01-02 00:00:00"), time.Now().Format("2006-01-02 23:59:59")}
if err = dao.GetRow(db, &count, sql2, sqlParams2); err == nil { //if err = dao.GetRow(db, &count, sql2, sqlParams2); err == nil {
order.StoreDayOrderCount = count.Count // order.StoreDayOrderCount = count.Count
} //}
return retVal, err return retVal, err
}, orders) }, orders)
tasksch.HandleTask(task, nil, true).Run() tasksch.HandleTask(task, nil, true).Run()