This commit is contained in:
邹宗楠
2023-05-22 14:42:26 +08:00
parent d936e5fc54
commit 784d60912c
3 changed files with 20 additions and 24 deletions

View File

@@ -123,15 +123,13 @@ func (a *Auther) GetUserType() (userType int8) {
return model.UserTypeStoreBoss return model.UserTypeStoreBoss
} }
func GetAPI(authType string) *weixinapi.API { func GetAPI(appID string) *weixinapi.API {
if authType == AuthTypeWeixin { miniApi := api.WeixinMiniAPI
return api.WeixinPageAPI if len(appID) > 0 && appID == api.WeixinMiniAppID2 {
miniApi = api.WeixinMiniAPI2
} }
if authType == AuthTypeWxApp { if len(appID) > 0 && appID == api.WeixinMiniAppIDsc {
return api.WeixinApp miniApi = api.WeixinMiniAPIsc
} }
if authType == AuthTypeWxAppCaishi { return miniApi
return api.WeixinApp2
}
return api.WeixinAPI
} }

View File

@@ -128,7 +128,7 @@ func NotifyPickOrder(order *model.GoodsOrder) (err error) {
order.NotifyType = int(store.SMSNotify) order.NotifyType = int(store.SMSNotify)
partner.CurOrderManager.UpdateOrderFields(order, []string{"NotifyType"}) partner.CurOrderManager.UpdateOrderFields(order, []string{"NotifyType"})
//品牌余额, 一条5分 //品牌余额, 一条5分
if order.CreateDeliveryType == model.YES { // 门店发单 //if order.CreateDeliveryType == model.YES { // 门店发单
noticeType := 0 noticeType := 0
switch feeType { switch feeType {
case model.BrandBillFeeTypeSms: case model.BrandBillFeeTypeSms:
@@ -137,9 +137,9 @@ func NotifyPickOrder(order *model.GoodsOrder) (err error) {
noticeType = partner.StoreAcctTypeExpendVoiceMessageNotify noticeType = partner.StoreAcctTypeExpendVoiceMessageNotify
} }
err = partner.CurStoreAcctManager.InsertStoreAcctExpendAndUpdateStoreAcctBalance(jxcontext.AdminCtx, store.ID, 5, noticeType, order.VendorOrderID, "", 0) err = partner.CurStoreAcctManager.InsertStoreAcctExpendAndUpdateStoreAcctBalance(jxcontext.AdminCtx, store.ID, 5, noticeType, order.VendorOrderID, "", 0)
} else if order.CreateDeliveryType == model.NO { // 品牌发单 /*} else if order.CreateDeliveryType == model.NO { // 品牌发单
err = partner.CurStoreAcctManager.InsertBrandBill(jxcontext.AdminCtx, store.BrandID, 5, model.BrandBillTypeExpend, feeType, order.VendorOrderID, "") err = partner.CurStoreAcctManager.InsertBrandBill(jxcontext.AdminCtx, store.BrandID, 5, model.BrandBillTypeExpend, feeType, order.VendorOrderID, "")
} }*/
return err return err
} }
balance, _ := partner.CurStoreAcctManager.GetBrandBalance(store.BrandID) balance, _ := partner.CurStoreAcctManager.GetBrandBalance(store.BrandID)

View File

@@ -448,13 +448,11 @@ type DeliveryFee struct {
// GetPlatformDesiredFee 统计平台的订单的配送费信息 // GetPlatformDesiredFee 统计平台的订单的配送费信息
func GetPlatformDesiredFee(db *DaoDB, storeIDs []int, finishedAtBegin, finishedAtEnd time.Time) (fee []*DeliveryFee, err error) { func GetPlatformDesiredFee(db *DaoDB, storeIDs []int, finishedAtBegin, finishedAtEnd time.Time) (fee []*DeliveryFee, err error) {
sql := ` sql := `
SELECT sum(b.actual_fee) actual_fee,b.order_vendor_id vendor_id FROM goods_order t2 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.status IN (?,?) AND b.vendor_order_id <> b.vendor_waybill_id 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 <= ? WHERE t2.order_finished_at >= ? AND t2.order_finished_at <= ?
` `
sqlParams := []interface{}{ sqlParams := []interface{}{
model.WaybillStatusDelivered,
110,
finishedAtBegin, finishedAtBegin,
finishedAtEnd, finishedAtEnd,
} }