Merge branch 'jdshop' of https://e.coding.net/rosydev/jx-callback into jdshop
This commit is contained in:
@@ -2,6 +2,7 @@ package bidding
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi/tiktok_shop/ascription_place"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
@@ -101,3 +102,30 @@ func QueryNeedDeleteSku() string {
|
||||
fmt.Println("dd2 ", len(dd))
|
||||
return strings.Join(dd, ",")
|
||||
}
|
||||
|
||||
func UpdateTiktokOrderPhoneAddress() error {
|
||||
var goodsOrder []*model.GoodsOrder
|
||||
var db = dao.GetDB()
|
||||
sql := `SELECT * FROM goods_order WHERE order_created_at >= "2023-02-01 00:00:00" AND vendor_id = "14" ORDER BY order_created_at DESC`
|
||||
if err := dao.GetRows(db, &goodsOrder, sql, nil); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, v := range goodsOrder {
|
||||
if v.PhoneAscription != "" {
|
||||
continue
|
||||
}
|
||||
ascription, err := ascription_place.Find(v.ConsigneeMobile)
|
||||
if err != nil {
|
||||
v.PhoneAscription = model.PhoneAscriptionAddressNo + "-" + err.Error()
|
||||
} else {
|
||||
if strings.Contains(v.ConsigneeAddress, ascription.Province) && strings.Contains(v.ConsigneeAddress, ascription.City) {
|
||||
v.PhoneAscription = model.PhoneAscriptionAddressYes + "-" + ascription.Province + ascription.City
|
||||
} else {
|
||||
v.PhoneAscription = model.PhoneAscriptionAddressNo + "-" + "归属信息不匹配:" + ascription.Province + ascription.City
|
||||
}
|
||||
}
|
||||
dao.UpdateEntity(db, v, "PhoneAscription")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -453,7 +453,7 @@ func (c *PurchaseHandler) PickupGoods(order *model.GoodsOrder, isSelfDelivery bo
|
||||
if err == nil {
|
||||
orderSettlement, _ := getAPI(order.VendorOrgCode).OrderShoudSettlementService2(order.VendorOrderID)
|
||||
UpdateOrderBySettleMent(order, orderSettlement)
|
||||
err = partner.CurOrderManager.UpdateOrderFields(order, []string{"NewEarningPrice"})
|
||||
err = partner.CurOrderManager.UpdateOrderFields(order, []string{"NewEarningPrice", "TotalShopMoney"})
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user