From 7e2bdec1fc06818dfa9e2a0300d56ac986f5a158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 26 May 2020 18:30:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E5=95=86=E5=9F=8E=E6=8A=8A?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=B0=9D=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/tempop/tempop.go | 60 +++++++++++++++++-------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/business/jxstore/tempop/tempop.go b/business/jxstore/tempop/tempop.go index 0419576b5..9257cd023 100644 --- a/business/jxstore/tempop/tempop.go +++ b/business/jxstore/tempop/tempop.go @@ -8,6 +8,8 @@ import ( "strings" "time" + "git.rosy.net.cn/baseapi/platformapi/jdshopapi" + "git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin" "git.rosy.net.cn/jx-callback/business/partner/delivery" "github.com/360EntSecGroup-Skylar/excelize" @@ -1498,7 +1500,7 @@ func addSku(outSkuId string, cagtegoryId int, shopCategories []int64, brandId in } func UploadJdsImage(ctx *jxcontext.Context) (err error) { - db := dao.GetDB() + // db := dao.GetDB() // result1, _ := api.JdShopAPI.GetProvince() // for _, v := range result1 { // place1, _ := dao.GetPlaceByName(db, v.AreaName, 1, 0) @@ -1583,31 +1585,35 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { // } // } - var stores []*model.Store - sql := ` - SELECT a.* - FROM store a - LEFT JOIN store_map b ON a.id = b.store_id AND b.vendor_id = 5 AND b.deleted_at = '1970-01-01 00:00:00' - WHERE 1=1 - AND (a.status = 1 OR a.status = 0) - AND b.id IS NULL - AND a.deleted_at = '1970-01-01 00:00:00' - ` - err = dao.GetRows(db, &stores, sql, nil) - for _, v := range stores { - storeMap := &model.StoreMap{ - Status: 1, - VendorID: model.VendorIDJDShop, - AutoPickup: 1, - DeliveryCompetition: 1, - PricePercentage: 100, - IsSync: 1, - SyncRule: 1, - } - _, err = cms.AddStoreVendorMap(ctx, db, model.VendorIDJDShop, "", v.ID, storeMap) - if err != nil { - continue - } - } + // var stores []*model.Store + // sql := ` + // SELECT a.* + // FROM store a + // LEFT JOIN store_map b ON a.id = b.store_id AND b.vendor_id = 5 AND b.deleted_at = '1970-01-01 00:00:00' + // WHERE 1=1 + // AND (a.status = 1 OR a.status = 0) + // AND b.id IS NULL + // AND a.deleted_at = '1970-01-01 00:00:00' + // ` + // err = dao.GetRows(db, &stores, sql, nil) + // for _, v := range stores { + // storeMap := &model.StoreMap{ + // Status: 1, + // VendorID: model.VendorIDJDShop, + // AutoPickup: 1, + // DeliveryCompetition: 1, + // PricePercentage: 100, + // IsSync: 1, + // SyncRule: 1, + // } + // _, err = cms.AddStoreVendorMap(ctx, db, model.VendorIDJDShop, "", v.ID, storeMap) + // if err != nil { + // continue + // } + // } + _, err = api.JdShopAPI.AllOrders(&jdshopapi.AllOrdersParam{ + Current: 1, + PageSize: 10, + }) return err }