This commit is contained in:
苏尹岚
2021-03-19 10:01:54 +08:00
parent c2954f52d2
commit 8dba6fe19f

View File

@@ -1761,37 +1761,37 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
v := batchItemList[0].(*model.StoreMap) v := batchItemList[0].(*model.StoreMap)
detail, _ := api.JdShop2API.ShopDetail(utils.Str2Int(v.VendorStoreID)) detail, _ := api.JdShop2API.ShopDetail(utils.Str2Int(v.VendorStoreID))
storeDetail, _ := dao.GetStoreDetail(db, v.StoreID, model.VendorIDJDShop, "2") storeDetail, _ := dao.GetStoreDetail(db, v.StoreID, model.VendorIDJDShop, "2")
var ( // var (
url2 string // url2 string
idCode string // idCode string
startTime string // startTime string
) // )
if storeDetail.IDCardFront != "" { // if storeDetail.IDCardFront != "" {
data2, _, _ := jxutils.DownloadFileByURL(storeDetail.IDCardFront) // data2, _, _ := jxutils.DownloadFileByURL(storeDetail.IDCardFront)
fileName := storeDetail.IDCardFront[strings.LastIndex(storeDetail.IDCardFront, "/")+1 : len(storeDetail.IDCardFront)] // fileName := storeDetail.IDCardFront[strings.LastIndex(storeDetail.IDCardFront, "/")+1 : len(storeDetail.IDCardFront)]
url2, _ = api.JdShop2API.UploadImageNew(data2, fileName) // url2, _ = api.JdShop2API.UploadImageNew(data2, fileName)
} else { // } else {
data2, _, _ := jxutils.DownloadFileByURL("http://image.jxc4.com/image/a9bfc170a950ab9a4c76bd10b48b222b.tem.jpg") // data2, _, _ := jxutils.DownloadFileByURL("http://image.jxc4.com/image/a9bfc170a950ab9a4c76bd10b48b222b.tem.jpg")
fileName := "a9bfc170a950ab9a4c76bd10b48b222b.tem.jpg" // fileName := "a9bfc170a950ab9a4c76bd10b48b222b.tem.jpg"
url2, _ = api.JdShop2API.UploadImageNew(data2, fileName) // url2, _ = api.JdShop2API.UploadImageNew(data2, fileName)
} // }
if storeDetail.IDCode == "" { // if storeDetail.IDCode == "" {
idCode = "610126198012230014" // idCode = "610126198012230014"
} else { // } else {
idCode = storeDetail.IDCode // idCode = storeDetail.IDCode
} // }
if storeDetail.IDValid == "" { // if storeDetail.IDValid == "" {
startTime = "2013-01-25 00:00:00" // startTime = "2013-01-25 00:00:00"
} else { // } else {
startTime = utils.Time2Str(utils.Str2Time(storeDetail.IDValid)) // startTime = utils.Time2Str(utils.Str2Time(storeDetail.IDValid))
} // }
ex := storeDetail.IDExpire // ex := storeDetail.IDExpire
if ex == "" { // if ex == "" {
ex = utils.Time2Str(utils.Str2Time(storeDetail.IDValid).AddDate(10, 0, 0)) // ex = utils.Time2Str(utils.Str2Time(storeDetail.IDValid).AddDate(10, 0, 0))
} // }
if !strings.Contains(ex, "00:00:00") { // if !strings.Contains(ex, "00:00:00") {
ex += " 00:00:00" // ex += " 00:00:00"
} // }
api.JdShop2API.UpdateBasic(&jdshopapi.UpdateBasicParam{ api.JdShop2API.UpdateBasic(&jdshopapi.UpdateBasicParam{
StoreID: detail.StoreID, StoreID: detail.StoreID,
StoreName: detail.StoreName, StoreName: detail.StoreName,