This commit is contained in:
momo 2023-10-07 16:42:40 +08:00
parent 9cfdfdbc77
commit c57f2acafd

View File

@ -744,7 +744,7 @@ func (d *defaultOrder) CreatePrePaymentByDeposit(ctx context.Context, in *Create
var table = gmodel.NewAllModels(d.MysqlConn).FsOrder.TableName()
var resUpdate *gorm.DB
if in.DeliveryMethod == constants.DELIVERYMETHODDIRECTMAIL {
var oosql = fmt.Sprintf("UPDATE %s SET `order_address` = JSON_MERGE_PATCH(`order_address`,?),`status_link` = JSON_MERGE_PATCH(`status_link`,?), `delivery_method` = ? , `utime` = ? WHERE `id` = ?", table)
var oosql = fmt.Sprintf("UPDATE %s SET `order_address` = JSON_MERGE_PATCH(`order_address`,?), `status_link` = JSON_MERGE_PATCH(`status_link`,?), `delivery_method` = ? , `utime` = ? WHERE `id` = ?", table)
resUpdate = d.MysqlConn.Exec(oosql, orderAddressByte, statusLinkByte, in.DeliveryMethod, ntime, orderInfo.Id)
} else {
resUpdate = d.MysqlConn.Exec(fmt.Sprintf("UPDATE %s SET `delivery_method` = ? , `utime` = ? WHERE `id` = ?", table), in.DeliveryMethod, ntime, orderInfo.Id)
@ -1154,10 +1154,7 @@ func (d *defaultOrder) Create(ctx context.Context, in *CreateReq) (res *CreateRe
var statusLink = order.GenerateOrderStatusLink(in.DeliveryMethod, nowTime, in.ExpectedDeliveryTime)
byteOrderProduct, _ := json.Marshal(orderProductList)
var byteOrderAddress []byte
if orderAddress != nil {
byteOrderAddress, _ = json.Marshal(orderAddress)
}
byteOrderAddress, _ := json.Marshal(orderAddress)
byteOrderAmount, _ := json.Marshal(orderAmount)
byteShoppingCartSnapshot, _ := json.Marshal(shoppingCartSnapshotList)