From 1c5c0bbbcc4f7e8dfabdb24a451ec6f20ecf0086 Mon Sep 17 00:00:00 2001 From: Rosy-zhudan Date: Thu, 10 Oct 2019 09:42:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/misc/Store_Alert_Inform.go | 2 -- business/jxutils/weixinmsg/weixinmsg.go | 4 +--- business/model/dao/Store_Alert_Inform.go | 7 +++++-- business/model/dao/dao_order.go | 10 +++++----- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/business/jxstore/misc/Store_Alert_Inform.go b/business/jxstore/misc/Store_Alert_Inform.go index 300afd605..524e6d178 100644 --- a/business/jxstore/misc/Store_Alert_Inform.go +++ b/business/jxstore/misc/Store_Alert_Inform.go @@ -96,8 +96,6 @@ func (s *StoreAlertDataWrapper) SetData(storeID int, valueName string, value int data.AlertDate = utils.GetCurDate() s.storeAlertList[storeID] = data } - // valueInfo := reflect.ValueOf(data).Elem() - // valueInfo.FieldByName(valueName).SetInt(int64(value)) if s.IsStatusField(valueName) { srcFieldValue := refutil.GetObjFieldByName(data, valueName).(int) value |= srcFieldValue diff --git a/business/jxutils/weixinmsg/weixinmsg.go b/business/jxutils/weixinmsg/weixinmsg.go index f6dfcc353..a47fd3d2d 100644 --- a/business/jxutils/weixinmsg/weixinmsg.go +++ b/business/jxutils/weixinmsg/weixinmsg.go @@ -644,8 +644,6 @@ func NotifyStoreStatusChanged(openUserID, title, content string) (err error) { func NotifyStoreAlertMessage(storeID int, storeName, title, content string) (err error) { globals.SugarLogger.Debugf("NotifyStoreAlertMessage storeID:%d, storeName:%d, title:%s, content:%s", storeID, storeName, title, content) templateID := WX_STORE_ALERT_TEMPLATE_ID - msgID, msgStatusID := -1, -1 - fileURL := globals.WxBackstageHost + fmt.Sprintf(WX_TO_SHOW_MSG, msgID, msgStatusID) data := map[string]interface{}{ "first": map[string]interface{}{ "value": "", @@ -667,5 +665,5 @@ func NotifyStoreAlertMessage(storeID int, storeName, title, content string) (err "value": "", }, } - return SendMsgToStore(storeID, templateID, fileURL, fmt.Sprintf(WX_MINI_TO_SHOW_MSG, msgID, msgStatusID), data) + return SendMsgToStore(storeID, templateID, "", "", data) } diff --git a/business/model/dao/Store_Alert_Inform.go b/business/model/dao/Store_Alert_Inform.go index cd7bcbf8e..690ccc464 100644 --- a/business/model/dao/Store_Alert_Inform.go +++ b/business/model/dao/Store_Alert_Inform.go @@ -4,6 +4,7 @@ import ( "fmt" "time" + "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/business/model" ) @@ -18,10 +19,12 @@ func GetStoreAlertList(db *DaoDB, storeIDList []int, cityCode int, keyWord strin FROM store_alert t1 JOIN store t2 ON t1.store_id = t2.id JOIN place t3 ON t2.city_code = t3.code - WHERE DATE(t1.alert_date) = DATE(?) + WHERE t1.alert_date >= ? AND t1.alert_date <= ? ` + beginTime, endTime := utils.GetTimeRange(dateTime, 1, true) sqlParams := []interface{}{ - dateTime, + beginTime, + endTime, } if len(storeIDList) > 0 { sql += ` diff --git a/business/model/dao/dao_order.go b/business/model/dao/dao_order.go index a8b22cdbb..5933c8406 100644 --- a/business/model/dao/dao_order.go +++ b/business/model/dao/dao_order.go @@ -444,8 +444,8 @@ func GetStandardPickTimeOrderCountByDaDa(db *DaoDB, dayNum int, includeToday boo sql := ` 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 <= ? + JOIN order_status t2 ON t1.vendor_order_id = t2.vendor_order_id AND t1.vendor_id = t2.vendor_id + WHERE t1.order_finished_at >= ? AND t1.order_finished_at <= ? AND t1.status = ? AND t1.waybill_vendor_id = ? AND t2.order_type = ? @@ -471,7 +471,7 @@ func GetStandardFinishTimeOrderCountBySelfDelivery(db *DaoDB, dayNum int, includ sql := ` SELECT jx_store_id store_id, order_created_at, order_finished_at FROM goods_order - where order_finished_at >= ? AND order_finished_at <= ? + WHERE order_finished_at >= ? AND order_finished_at <= ? AND status = ? AND waybill_vendor_id = ? ` @@ -506,8 +506,8 @@ func GetStandardPickUpTimeOrderCountByDaDa(db *DaoDB, dayNum int, includeToday b sql := ` SELECT t1.jx_store_id store_id, t1.vendor_order_id, t2.status_time, t2.status 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 <= ? + JOIN order_status t2 ON t1.vendor_order_id = t2.vendor_order_id AND t1.vendor_id = t2.vendor_id + WHERE t1.order_finished_at >= ? AND t1.order_finished_at <= ? AND t1.status = ? AND t1.waybill_vendor_id = ? AND t2.status in (?, ?)