去掉微盟微商城相关的代码
This commit is contained in:
@@ -55,10 +55,9 @@ func (c *OrderManager) GetStoreOrderCountInfo(ctx *jxcontext.Context, storeID, l
|
||||
sql := `
|
||||
SELECT t1.lock_status, t1.status, COUNT(*) count
|
||||
FROM goods_order t1
|
||||
WHERE t1.vendor_id <> 2 AND IF(t1.vendor_id = ?, t1.store_id, IF(t1.jx_store_id != 0, t1.jx_store_id, t1.store_id) ) = ?
|
||||
WHERE t1.vendor_id <> 2 AND IF(t1.jx_store_id != 0, t1.jx_store_id, t1.store_id) = ?
|
||||
AND t1.order_created_at >= ?`
|
||||
sqlParams := []interface{}{
|
||||
model.VendorIDWSC,
|
||||
storeID,
|
||||
time.Now().Add(-time.Duration(lastHours) * time.Hour),
|
||||
}
|
||||
@@ -198,14 +197,14 @@ func (c *OrderManager) ExportMTWaybills(ctx *jxcontext.Context, fromDateStr, toD
|
||||
toDate = toDate.Add(24 * time.Hour)
|
||||
var waybills []*tWaybillExt
|
||||
sql := `
|
||||
SELECT t1.*, t2.store_name, IF(t1.vendor_id = ?, t1.store_id, IF(t1.jx_store_id != 0, t1.jx_store_id, t1.store_id) ) store_id
|
||||
SELECT t1.*, t2.store_name, IF(t1.jx_store_id != 0, t1.jx_store_id, t1.store_id) store_id
|
||||
FROM waybill t1
|
||||
JOIN goods_order t2 ON t1.vendor_order_id = t2.vendor_order_id
|
||||
WHERE t1.waybill_vendor_id = 102 AND t1.status = 105 AND t1.waybill_created_at >= ? AND t1.waybill_created_at <= ?
|
||||
ORDER BY t1.id
|
||||
`
|
||||
db := dao.GetDB()
|
||||
if err = dao.GetRows(db, &waybills, sql, model.VendorIDWSC, fromDate, toDate); err == nil {
|
||||
if err = dao.GetRows(db, &waybills, sql, fromDate, toDate); err == nil {
|
||||
config := []*excel.Obj2ExcelSheetConfig{
|
||||
&excel.Obj2ExcelSheetConfig{
|
||||
Title: "Sheet1",
|
||||
@@ -334,8 +333,8 @@ func (c *OrderManager) getOrders(ctx *jxcontext.Context, isIncludeSku, isInclude
|
||||
if storeIDs[0] == 0 { // 容错
|
||||
sqlWhere += " AND 1 = 0"
|
||||
} else {
|
||||
sqlWhere += " AND IF(t1.vendor_id = ?, t1.store_id, IF(t1.jx_store_id != 0, t1.jx_store_id, t1.store_id) ) IN (" + dao.GenQuestionMarks(len(storeIDs)) + ")"
|
||||
sqlParams = append(sqlParams, model.VendorIDWSC, storeIDs)
|
||||
sqlWhere += " AND IF(t1.jx_store_id != 0, t1.jx_store_id, t1.store_id) IN (" + dao.GenQuestionMarks(len(storeIDs)) + ")"
|
||||
sqlParams = append(sqlParams, storeIDs)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -560,17 +559,16 @@ func (c *OrderManager) GetWaybills(ctx *jxcontext.Context, fromDateStr, toDateSt
|
||||
offset = 0
|
||||
}
|
||||
|
||||
sqlParams := []interface{}{
|
||||
model.VendorIDWSC,
|
||||
fromDate,
|
||||
toDate,
|
||||
}
|
||||
sql := `
|
||||
SELECT SQL_CALC_FOUND_ROWS t1.*, t2.store_name, IF(t1.vendor_id = ?, t1.store_id, IF(t1.jx_store_id != 0, t1.jx_store_id, t1.store_id) ) store_id
|
||||
SELECT SQL_CALC_FOUND_ROWS t1.*, t2.store_name, IF(t1.jx_store_id != 0, t1.jx_store_id, t1.store_id) store_id
|
||||
FROM waybill t1
|
||||
JOIN goods_order t2 ON t1.vendor_order_id = t2.vendor_order_id
|
||||
WHERE t1.status = 105 AND t1.waybill_created_at >= ? AND t1.waybill_created_at < ?
|
||||
`
|
||||
sqlParams := []interface{}{
|
||||
fromDate,
|
||||
toDate,
|
||||
}
|
||||
if params["keyword"] != nil {
|
||||
keyword := params["keyword"].(string)
|
||||
keywordLike := "%" + keyword + "%"
|
||||
@@ -712,8 +710,8 @@ func (c *OrderManager) GetOrdersFinancial(ctx *jxcontext.Context, fromDateStr, t
|
||||
return nil, err
|
||||
}
|
||||
if len(storeIDs) > 0 {
|
||||
sqlWhere += " AND IF(t1.vendor_id = ?, t2.store_id, IF(t2.jx_store_id != 0, t2.jx_store_id, t2.store_id)) IN (" + dao.GenQuestionMarks(len(storeIDs)) + ")"
|
||||
sqlParams = append(sqlParams, model.VendorIDWSC, storeIDs)
|
||||
sqlWhere += " AND IF(t2.jx_store_id != 0, t2.jx_store_id, t2.store_id) IN (" + dao.GenQuestionMarks(len(storeIDs)) + ")"
|
||||
sqlParams = append(sqlParams, storeIDs)
|
||||
}
|
||||
}
|
||||
if params["statuss"] != nil {
|
||||
@@ -1066,11 +1064,11 @@ func (c *OrderManager) GetStoreAfsOrderCountInfo(ctx *jxcontext.Context, storeID
|
||||
err = dao.GetRows(db, &countInfo, `
|
||||
SELECT 0 lock_status, t1.status, COUNT(*) count
|
||||
FROM afs_order t1
|
||||
WHERE t1.vendor_id <> 2 AND IF(t1.vendor_id = ?, t1.store_id, IF(t1.jx_store_id != 0, t1.jx_store_id, t1.store_id) ) = ?
|
||||
WHERE t1.vendor_id <> 2 AND IF(t1.jx_store_id != 0, t1.jx_store_id, t1.store_id) = ?
|
||||
AND t1.afs_created_at >= ?
|
||||
GROUP BY 1,2
|
||||
ORDER BY 1,2
|
||||
`, model.VendorIDWSC, storeID, time.Now().Add(-time.Duration(lastHours)*time.Hour))
|
||||
`, storeID, time.Now().Add(-time.Duration(lastHours)*time.Hour))
|
||||
if err == nil {
|
||||
return countInfo, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user