This commit is contained in:
苏尹岚
2020-12-31 17:29:18 +08:00
parent 3de4615719
commit a561368cf4
5 changed files with 55 additions and 20 deletions

View File

@@ -20,7 +20,7 @@ import (
"git.rosy.net.cn/jx-callback/business/model"
)
func CreateOrder(ctx *jxcontext.Context, orderType int, way string, price int, lng, lat float64) (orderID, errCode string, err error) {
func CreateOrder(ctx *jxcontext.Context, type1, orderType int, way string, price int, lng, lat float64) (orderID, errCode string, err error) {
var (
db = dao.GetDB()
order *model.Order
@@ -29,7 +29,7 @@ func CreateOrder(ctx *jxcontext.Context, orderType int, way string, price int, l
if err = auth2.CheckWeixinminiAuthBind(ctx.GetUserID()); err != nil {
return "", errCode, err
}
if orderType == model.OrderTypeCash {
if type1 == model.OrderTypeCash {
//如果用户没有对应账单信息就给他生成一条
userBill, err := dao.GetUserBill(db, ctx.GetUserID(), "")
if userBill == nil {
@@ -51,7 +51,8 @@ func CreateOrder(ctx *jxcontext.Context, orderType int, way string, price int, l
order = &model.Order{
OrderID: utils.Int64ToStr(jxutils.GenOrderNo()),
UserID: ctx.GetUserID(),
Type: orderType,
Type: type1,
OrderType: orderType,
Way: way,
Status: model.OrderStatusWait4Pay,
PayPrice: price,