添加用户提现操作
This commit is contained in:
@@ -49,7 +49,6 @@ func QueryExpressPrice(param *bida.GetExpressPriceReq) (map[string]*bida.GetExpr
|
||||
}
|
||||
|
||||
// 给快递默认值
|
||||
|
||||
result := make(map[string]*bida.GetExpressPriceRes, 0)
|
||||
if param.Type == 0 {
|
||||
// 渠道费每公斤加价五毛
|
||||
@@ -464,11 +463,11 @@ func ManagerGetOrderList(param *model.OrderListReq) ([]*model.UserVendorOrder, i
|
||||
paramSql = append(paramSql, param.StartTime, param.EndTime)
|
||||
}
|
||||
if param.ExpressType != 0 {
|
||||
sql += `AND ou.type = ? `
|
||||
sql += ` AND ou.type = ? `
|
||||
paramSql = append(paramSql, param.ExpressType)
|
||||
}
|
||||
if param.OrderStatus != 0 {
|
||||
sql += `AND ou.order_status = ? `
|
||||
sql += ` AND ou.order_status = ? `
|
||||
paramSql = append(paramSql, param.OrderStatus)
|
||||
}
|
||||
if param.PageNum == 0 {
|
||||
@@ -493,6 +492,7 @@ func ManagerGetOrderList(param *model.OrderListReq) ([]*model.UserVendorOrder, i
|
||||
return nil, 0, err
|
||||
}
|
||||
count := dao.GetLastTotalRowCountTx(txdb)
|
||||
dao.Commit(db, txdb)
|
||||
return result, count, nil
|
||||
}
|
||||
|
||||
@@ -556,3 +556,75 @@ func UpdateOrderStatus() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TryAgainOrder 再来一单
|
||||
func TryAgainOrder(ctx *jxcontext.Context, oldNo string) (*model.UserVendorOrder, error) {
|
||||
sql := `SELECT * FROM user_vendor_order WHERE local_way_bill = ?`
|
||||
var oldOrder *model.UserVendorOrder
|
||||
if err := dao.GetRow(dao.GetDB(), &oldOrder, sql, []interface{}{oldNo}...); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 获取用户发货地址信息
|
||||
sendAddress, countSend, err := dao.QueryUserDeliveryAddress(dao.GetDB(), oldOrder.SenderAddressID, nil, 0, 1, 10)
|
||||
if err != nil || countSend != model.YES {
|
||||
return nil, errors.New("查询错误/送货地址信息不正确")
|
||||
}
|
||||
// 获取用户收货
|
||||
receiveAddress, receiveSend, err := dao.QueryUserDeliveryAddress(dao.GetDB(), oldOrder.SenderAddressID, nil, 0, 1, 10)
|
||||
if err != nil || receiveSend != model.YES {
|
||||
return nil, errors.New("查询错误/收货地址信息不正确")
|
||||
}
|
||||
|
||||
// 查询配送费选择最低的
|
||||
fee, err := QueryExpressPrice(&bida.GetExpressPriceReq{
|
||||
Type: oldOrder.Type,
|
||||
PromiseTimeType: oldOrder.PromiseTimeType,
|
||||
DeliveryType: oldOrder.DeliveryType,
|
||||
GoodsValue: oldOrder.GuarantFee,
|
||||
ReceiveAddress: receiveAddress[0].AutoAddress,
|
||||
SendAddress: sendAddress[0].AutoAddress,
|
||||
Weight: oldOrder.Weight,
|
||||
Length: oldOrder.Length,
|
||||
Height: oldOrder.Height,
|
||||
Width: oldOrder.Width,
|
||||
SendPhone: sendAddress[0].ConsigneeMobile,
|
||||
ChannelType: oldOrder.ChannelType,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
param := &model.MakeOrderParamReq{
|
||||
PromiseTimeType: oldOrder.PromiseTimeType,
|
||||
DeliveryType: oldOrder.DeliveryType,
|
||||
Goods: oldOrder.Goods,
|
||||
GuaranteeValueAmount: oldOrder.GuaranteeValueAmount,
|
||||
Weight: oldOrder.Weight,
|
||||
Length: oldOrder.Length,
|
||||
Height: oldOrder.Height,
|
||||
Width: oldOrder.Width,
|
||||
OrderSendTime: oldOrder.OrderSendTime,
|
||||
PackageNum: oldOrder.PackageNum,
|
||||
ReceiveAddressId: oldOrder.ReceiveAddressID,
|
||||
ReceiveAddress: receiveAddress[0].AutoAddress,
|
||||
ReceiveName: receiveAddress[0].ConsigneeName,
|
||||
ReceivePhone: receiveAddress[0].ConsigneeMobile,
|
||||
Remark: oldOrder.Remark,
|
||||
SenderAddressId: oldOrder.SenderAddressID,
|
||||
SenderAddress: sendAddress[0].AutoAddress,
|
||||
SenderName: sendAddress[0].ConsigneeName,
|
||||
SenderPhone: sendAddress[0].ConsigneeMobile,
|
||||
ThirdPlatform: oldOrder.ThirdPlatform,
|
||||
Type: oldOrder.Type,
|
||||
ChannelType: oldOrder.ChannelType,
|
||||
Images: oldOrder.Img,
|
||||
ChannelFee: fee[fmt.Sprintf("%d", oldOrder.Type)].Data.ChannelFee,
|
||||
Bulk: utils.Int2Float64(fee[fmt.Sprintf("%d", oldOrder.Type)].Data.Bulk),
|
||||
ServiceCharge: fee[fmt.Sprintf("%d", oldOrder.Type)].Data.ServiceCharge,
|
||||
GuarantFee: fee[fmt.Sprintf("%d", oldOrder.Type)].Data.GuarantFee,
|
||||
OriginalFee: utils.Int2Float64(fee[fmt.Sprintf("%d", oldOrder.Type)].Data.OriginalFee),
|
||||
Increment: fee[fmt.Sprintf("%d", oldOrder.Type)].Data.IncrementFee,
|
||||
}
|
||||
return CreateWayOrder(ctx, param, oldOrder.UserId)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user