From 6180f69883818103b32d5ead0f98fd8db1381a87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Fri, 21 Feb 2025 09:56:11 +0800 Subject: [PATCH] 1 --- business/jxstore/cms/store_sku.go | 4 ++-- business/model/dao/dao_bz.go | 4 +--- business/partner/purchase/mtwm/callback.go | 9 ++++++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index c0eaab76a..4225ae4e0 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -2456,6 +2456,7 @@ func updateStoreSkusSaleWithoutSync(ctx *jxcontext.Context, storeID int, skuBind model.FieldMtwmSyncStatus: skuBind.MtwmSyncStatus | model.SyncFlagSaleMask, model.FieldTaoSyncStatus: skuBind.TaoSyncStatus | model.SyncFlagSaleMask, model.FieldDdSyncStatus: skuBind.DdSyncStatus | model.SyncFlagSaleMask, + "Stock": v.Stock, } if utils.IsTimeZero(autoSaleTime) || skuBind.Status == model.SkuStatusNormal { kvs["AutoSaleAt"] = utils.DefaultTimeValue @@ -2527,8 +2528,7 @@ func UpdateStoresSkusSale(ctx *jxcontext.Context, storeIDs []int, skuBindSkuInfo for _, v := range skuBindSkuInfos { skuIDs = append(skuIDs, v.SkuID) } - db := dao.GetDB() - hint, err = CurVendorSync.SyncStoresSkus(ctx, nil, 0, db, nil, storeIDs, skuIDs, false, isAsync, isContinueWhenError) + hint, err = CurVendorSync.SyncStoresSkus(ctx, nil, 0, dao.GetDB(), nil, storeIDs, skuIDs, false, isAsync, isContinueWhenError) } if num == 0 || !isAsync || hint == "" { hint = utils.Int64ToStr(num) diff --git a/business/model/dao/dao_bz.go b/business/model/dao/dao_bz.go index 1010574cd..c9f95ff41 100644 --- a/business/model/dao/dao_bz.go +++ b/business/model/dao/dao_bz.go @@ -54,13 +54,11 @@ func UpdateEntityByKV(db *DaoDB, item interface{}, kvs map[string]interface{}, c qs = qs.Filter(k, v) } } - globals.SugarLogger.Debugf("-------kvs:= %s", utils.Format4Output(kvs, false)) for k, v := range kvs { - if v == "" { + if v == "" || v == nil { delete(kvs, k) } } - globals.SugarLogger.Debugf("-------kvs2:= %s", utils.Format4Output(kvs, false)) num, err = qs.Update(kvs) if err != nil && !IsDuplicateError(err) { globals.SugarLogger.Errorf("UpdateEntityByKV %s failed with error:%v", reflect.TypeOf(item).Name(), err) diff --git a/business/partner/purchase/mtwm/callback.go b/business/partner/purchase/mtwm/callback.go index f0b4b54c9..28c86832a 100644 --- a/business/partner/purchase/mtwm/callback.go +++ b/business/partner/purchase/mtwm/callback.go @@ -118,5 +118,12 @@ func pushIMToGyOrPet(msg *mtwmapi.ImCallbackMsg, serverType string) { } request.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8") - cl.Do(request) + request.Header.Set("accept", "application/json, text/plain, */*") + resp, err := cl.Do(request) + if err != nil { + return + } + defer resp.Body.Close() + + return }