京东
This commit is contained in:
@@ -1585,7 +1585,35 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
|
||||
// fmt.Println("deleteList2", deleteList)
|
||||
// cms.DeletedDuplicateWaitAuditData(ctx, dao.GetDB())
|
||||
// orderman.RefreshJdShopOrdersEarningPrice(jxcontext.AdminCtx, time.Now().AddDate(0, 0, -2).Format("20060102"), time.Now().Format("20060102"))
|
||||
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
goods []*model.GoodsOrder
|
||||
)
|
||||
sql := `SELECT * from goods_order where vendor_id = 0 and buyer_comment = '【JD】' and total_shop_money = 0 and status = 110
|
||||
AND order_created_at > '2020-09-01'`
|
||||
dao.GetRows(db, &goods, sql, nil)
|
||||
for _, order2 := range goods {
|
||||
results, err := api.JdAPI.GetJdShopOrders(order2.OrderCreatedAt.AddDate(0, 0, -1).Format("20060102"), order2.OrderCreatedAt.Format("20060102"), globals.JdOrgCode, globals.JdLoginName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, v := range results.BillList.Result {
|
||||
if v.DueAmount != 0 {
|
||||
order, _ := partner.CurOrderManager.LoadOrder(utils.Int64ToStr(v.OrderID), model.VendorIDJD)
|
||||
stores, _ := dao.GetStoreList(db, []int{jxutils.GetSaleStoreIDFromOrder(order)}, nil, nil, nil, "")
|
||||
if len(stores) > 0 {
|
||||
store := stores[0]
|
||||
if order.NewEarningPrice == 0 {
|
||||
jxutils.RefreshOrderEarningPrice2(order, store.PayPercentage)
|
||||
}
|
||||
if order.TotalShopMoney == 0 {
|
||||
order.TotalShopMoney = utils.Float64TwoInt64(v.DueAmount * 100)
|
||||
}
|
||||
dao.UpdateEntity(db, order, "TotalShopMoney", "NewEarningPrice")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user