pay
This commit is contained in:
@@ -199,10 +199,6 @@ func PayByBalance(ctx *jxcontext.Context, orderID string, isChoose, payType int,
|
||||
if err = dao.UpdateUserBill(userBill.UserID, money); err != nil {
|
||||
return nil, "余额支付失败", err
|
||||
}
|
||||
//if err = financial.AddExpendUpdateAccount(txDB, userBill, model.BillTypePayByAccountBalance, orderInfo.PayPrice, 0); err != nil {
|
||||
// //dao.Rollback(db, txDB)
|
||||
// return nil, "使用余额支付失败:", err
|
||||
//}
|
||||
//更新订单状态
|
||||
globals.SugarLogger.Debug("更新订单状态")
|
||||
temp_method := 1
|
||||
@@ -210,16 +206,10 @@ func PayByBalance(ctx *jxcontext.Context, orderID string, isChoose, payType int,
|
||||
if _, err := dao.SetOrderStatus(orderInfo.PayPrice, temp_method, temp_status, orderID); err != nil {
|
||||
return nil, "更新order状态失败", err
|
||||
}
|
||||
userOrder := model.UserVendorOrder{LocalWayBill: orderInfo.OrderID}
|
||||
userOrder.OrderStatus = 4 //快递单已支付
|
||||
if _, err := dao.UpdateEntity(db, &userOrder, "OrderStatus"); err != nil {
|
||||
temp_vendor_status := 4
|
||||
if _, err := dao.SetUserVendorOrderStatus(orderInfo.OrderID, temp_vendor_status); err != nil {
|
||||
return nil, "更新user_vendor_order状态失败", err
|
||||
}
|
||||
//if _, err := dao.UpdateEntityTx(txDB, order); err != nil {
|
||||
// dao.Rollback(db, txDB)
|
||||
// return nil, "", err
|
||||
//}
|
||||
//dao.Commit(db, txDB)
|
||||
}
|
||||
if isChoose == Choose {
|
||||
//(1)用户不使用余额或者余额=0 即直接微信支付
|
||||
|
||||
@@ -669,19 +669,9 @@ func GetUnionOrdersPage(db *DaoDB, vendorIDs, statuss []int, beginTime, endTime
|
||||
return page, err
|
||||
}
|
||||
|
||||
func SetUserVendorOrderStatus(db *DaoDB, localWayBillID string, status int) (msg string, err error) {
|
||||
sqlParams := []interface{}{}
|
||||
sql := `UPDATE user_vendor_order a SET a.order_status = ?`
|
||||
if status > 0 {
|
||||
sqlParams = append(sqlParams, status)
|
||||
}
|
||||
if localWayBillID != "" {
|
||||
sql += `WHERE a.local_way_bill = ?`
|
||||
sqlParams = append(sqlParams, localWayBillID)
|
||||
}
|
||||
Infos := &model.UserVendorOrder{}
|
||||
if err := GetRow(db, Infos, sql, sqlParams); err != nil {
|
||||
return "更新UserVendorOrder状态失败", err
|
||||
func SetUserVendorOrderStatus(localWayBillID string, status int) (msg string, err error) {
|
||||
if _, err := ExecuteSQL(GetDB(), "UPDATE `user_vendor_order` SET order_status = ? WHERE local_way_bill = ? ", []interface{}{status, localWayBillID}...); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return "更新UserVendorOrder状态成功", err
|
||||
}
|
||||
@@ -695,4 +685,4 @@ func SetOrderStatus(payPrice, payMethod, status int, orderID string) (string, er
|
||||
return "更新Order状态成功", nil
|
||||
}
|
||||
|
||||
//更新order 支付状态和
|
||||
//更新user_vendor_order 支付状态
|
||||
|
||||
Reference in New Issue
Block a user