From 784d60912c9522faa0883c6e623e731506e0907f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 22 May 2023 14:42:26 +0800 Subject: [PATCH] 1 --- business/auth2/authprovider/weixin/weixin.go | 16 +++++++------- business/jxutils/smsmsg/smsmsg.go | 22 ++++++++++---------- business/model/dao/dao_order.go | 6 ++---- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/business/auth2/authprovider/weixin/weixin.go b/business/auth2/authprovider/weixin/weixin.go index 1295f2341..5fe831d12 100644 --- a/business/auth2/authprovider/weixin/weixin.go +++ b/business/auth2/authprovider/weixin/weixin.go @@ -123,15 +123,13 @@ func (a *Auther) GetUserType() (userType int8) { return model.UserTypeStoreBoss } -func GetAPI(authType string) *weixinapi.API { - if authType == AuthTypeWeixin { - return api.WeixinPageAPI +func GetAPI(appID string) *weixinapi.API { + miniApi := api.WeixinMiniAPI + if len(appID) > 0 && appID == api.WeixinMiniAppID2 { + miniApi = api.WeixinMiniAPI2 } - if authType == AuthTypeWxApp { - return api.WeixinApp + if len(appID) > 0 && appID == api.WeixinMiniAppIDsc { + miniApi = api.WeixinMiniAPIsc } - if authType == AuthTypeWxAppCaishi { - return api.WeixinApp2 - } - return api.WeixinAPI + return miniApi } diff --git a/business/jxutils/smsmsg/smsmsg.go b/business/jxutils/smsmsg/smsmsg.go index 970accba3..4e908a8b8 100644 --- a/business/jxutils/smsmsg/smsmsg.go +++ b/business/jxutils/smsmsg/smsmsg.go @@ -128,18 +128,18 @@ func NotifyPickOrder(order *model.GoodsOrder) (err error) { order.NotifyType = int(store.SMSNotify) partner.CurOrderManager.UpdateOrderFields(order, []string{"NotifyType"}) //品牌余额, 一条5分 - if order.CreateDeliveryType == model.YES { // 门店发单 - noticeType := 0 - switch feeType { - case model.BrandBillFeeTypeSms: - noticeType = partner.StoreAcctTypeExpendTextMessageNotify - case model.BrandBillFeeTypeVoice: - noticeType = partner.StoreAcctTypeExpendVoiceMessageNotify - } - err = partner.CurStoreAcctManager.InsertStoreAcctExpendAndUpdateStoreAcctBalance(jxcontext.AdminCtx, store.ID, 5, noticeType, order.VendorOrderID, "", 0) - } else if order.CreateDeliveryType == model.NO { // 品牌发单 - err = partner.CurStoreAcctManager.InsertBrandBill(jxcontext.AdminCtx, store.BrandID, 5, model.BrandBillTypeExpend, feeType, order.VendorOrderID, "") + //if order.CreateDeliveryType == model.YES { // 门店发单 + noticeType := 0 + switch feeType { + case model.BrandBillFeeTypeSms: + noticeType = partner.StoreAcctTypeExpendTextMessageNotify + case model.BrandBillFeeTypeVoice: + noticeType = partner.StoreAcctTypeExpendVoiceMessageNotify } + err = partner.CurStoreAcctManager.InsertStoreAcctExpendAndUpdateStoreAcctBalance(jxcontext.AdminCtx, store.ID, 5, noticeType, order.VendorOrderID, "", 0) + /*} else if order.CreateDeliveryType == model.NO { // 品牌发单 + err = partner.CurStoreAcctManager.InsertBrandBill(jxcontext.AdminCtx, store.BrandID, 5, model.BrandBillTypeExpend, feeType, order.VendorOrderID, "") + }*/ return err } balance, _ := partner.CurStoreAcctManager.GetBrandBalance(store.BrandID) diff --git a/business/model/dao/dao_order.go b/business/model/dao/dao_order.go index 1f8f61857..a9e6ff004 100644 --- a/business/model/dao/dao_order.go +++ b/business/model/dao/dao_order.go @@ -448,13 +448,11 @@ type DeliveryFee struct { // GetPlatformDesiredFee 统计平台的订单的配送费信息 func GetPlatformDesiredFee(db *DaoDB, storeIDs []int, finishedAtBegin, finishedAtEnd time.Time) (fee []*DeliveryFee, err error) { sql := ` - SELECT sum(b.actual_fee) actual_fee,b.order_vendor_id vendor_id FROM goods_order t2 - RIGHT JOIN waybill b ON t2.vendor_order_id = b.vendor_order_id AND b.status IN (?,?) AND b.vendor_order_id <> b.vendor_waybill_id + SELECT sum(b.desired_fee) actual_fee,b.order_vendor_id vendor_id FROM goods_order t2 + RIGHT JOIN waybill b ON t2.vendor_order_id = b.vendor_order_id AND b.vendor_order_id <> b.vendor_waybill_id WHERE t2.order_finished_at >= ? AND t2.order_finished_at <= ? ` sqlParams := []interface{}{ - model.WaybillStatusDelivered, - 110, finishedAtBegin, finishedAtEnd, }