From 04ae92b33c983174f28977975e0829383ecbc8db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 2 Apr 2021 09:55:36 +0800 Subject: [PATCH] aa --- business/jxstore/tempop/tempop.go | 39 +++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/business/jxstore/tempop/tempop.go b/business/jxstore/tempop/tempop.go index 9c38df73e..edf647ca3 100644 --- a/business/jxstore/tempop/tempop.go +++ b/business/jxstore/tempop/tempop.go @@ -1879,18 +1879,37 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { // tasksch.HandleTask(task, nil, true).Run() // _, err = task.GetResult(0) //京东账号更新 + // var ( + // db = dao.GetDB() + // ) + // if configs, err := dao.QueryConfigs(dao.GetDB(), "jdConfigCookie", model.ConfigTypeCookie, ""); err == nil { + // api.JdAPI.SetCookieWithStr(configs[0].Value) + // result, _ := api.JdAPI.GetJdAppInfo() + // if result != nil { + // if vocs, _ := dao.GetVendorOrgCode(db, model.VendorIDJD, result.OrgCode, model.VendorOrgTypePlatform); len(vocs) > 0 { + // vocs[0].AppKey = result.AppKey + // vocs[0].AppSecret = result.AppSecret + // dao.UpdateEntity(db, vocs[0], "AppKey", "AppSecret") + // } + // } + // } var ( - db = dao.GetDB() + db = dao.GetDB() + users []*model.User ) - if configs, err := dao.QueryConfigs(dao.GetDB(), "jdConfigCookie", model.ConfigTypeCookie, ""); err == nil { - api.JdAPI.SetCookieWithStr(configs[0].Value) - result, _ := api.JdAPI.GetJdAppInfo() - if result != nil { - if vocs, _ := dao.GetVendorOrgCode(db, model.VendorIDJD, result.OrgCode, model.VendorOrgTypePlatform); len(vocs) > 0 { - vocs[0].AppKey = result.AppKey - vocs[0].AppSecret = result.AppSecret - dao.UpdateEntity(db, vocs[0], "AppKey", "AppSecret") - } + sql := ` + SELECT DISTINCT a.* FROM user a + LEFT JOIN auth_bind b ON a.user_id2 = b.auth_id + WHERE name IN ( + SELECT name FROM user WHERE deleted_at = '1970-01-01 00:00:00' GROUP BY name HAVING COUNT(*) > 1 ) + AND a.mobile is null AND a.user_id <> b.user_id + ORDER BY a.name + ` + dao.GetRows(db, &users, sql, nil) + for _, v := range users { + tokens, _ := api.Cacher.Keys(v.UserID) + for _, vv := range tokens { + api.Cacher.Del(vv) } } return err