门店触犯红线通知
This commit is contained in:
@@ -435,7 +435,7 @@ func GetFinishOrderCountByWayBillVendorID(db *DaoDB, wayBillVendorID, dayNum int
|
||||
//拣货履约订单量, 仅统计达达专送
|
||||
func GetStandardPickTimeOrderCountByDaDa(db *DaoDB, dayNum int, includeToday bool) (storeCountList []*model.StoreCount, err error) {
|
||||
sql := `
|
||||
SELECT jx_store_id store_id, COUNT(*) count
|
||||
SELECT t1.jx_store_id store_id, COUNT(*) count
|
||||
FROM goods_order t1
|
||||
JOIN order_status t2 ON t2.vendor_order_id = t1.vendor_order_id
|
||||
where t1.order_finished_at >= ? AND t1.order_finished_at <= ?
|
||||
@@ -444,7 +444,7 @@ func GetStandardPickTimeOrderCountByDaDa(db *DaoDB, dayNum int, includeToday boo
|
||||
AND t2.order_type = ?
|
||||
AND t2.status = ?
|
||||
AND t2.status_time <= t1.pick_deadline
|
||||
GROUP BY jx_store_id
|
||||
GROUP BY t1.jx_store_id
|
||||
`
|
||||
beginTime, endTime := utils.GetTimeRange(utils.GetCurDate(), dayNum, includeToday)
|
||||
sqlParams := []interface{}{
|
||||
@@ -495,7 +495,7 @@ func GetStandardFinishTimeOrderCountBySelfDelivery(db *DaoDB, dayNum int, includ
|
||||
}
|
||||
|
||||
//10分钟取货完成订单量, 仅统计达达专送
|
||||
func GetStandardPickUpTimeOrderCountBySelfDelivery(db *DaoDB, dayNum int, includeToday bool) (storeCountList []*model.StoreCount, err error) {
|
||||
func GetStandardPickUpTimeOrderCountByDaDa(db *DaoDB, dayNum int, includeToday bool) (storeCountList []*model.StoreCount, err error) {
|
||||
sql := `
|
||||
SELECT t1.jx_store_id store_id, t1.vendor_order_id, t2.status_time, t2.status
|
||||
FROM goods_order t1
|
||||
@@ -562,3 +562,23 @@ func GetStandardPickUpTimeOrderCountBySelfDelivery(db *DaoDB, dayNum int, includ
|
||||
|
||||
return storeCountList, err
|
||||
}
|
||||
|
||||
//风控定单(门店相关人员在自己的门店下单)
|
||||
func GetRiskOrderCount(db *DaoDB, dayNum int, includeToday bool) (storeOrderList []*model.StoreOrder, err error) {
|
||||
sql := `
|
||||
SELECT t1.jx_store_id store_id, t1.vendor_order_id
|
||||
FROM goods_order t1
|
||||
JOIN store t2 ON t2.id = t1.jx_store_id
|
||||
WHERE t1.order_finished_at >= ? AND t1.order_finished_at <= ?
|
||||
AND t1.consignee_mobile2 <> ""
|
||||
AND (t1.consignee_mobile2 = t2.tel1 or t1.consignee_mobile2 = t2.tel2)
|
||||
GROUP BY t1.jx_store_id
|
||||
`
|
||||
beginTime, endTime := utils.GetTimeRange(utils.GetCurDate(), dayNum, includeToday)
|
||||
sqlParams := []interface{}{
|
||||
beginTime,
|
||||
endTime,
|
||||
}
|
||||
|
||||
return storeOrderList, GetRows(db, &storeOrderList, sql, sqlParams)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user