提现城市分成比例

This commit is contained in:
苏尹岚
2020-11-11 10:17:22 +08:00
parent 97f9e44e8a
commit cd156feba9
4 changed files with 26 additions and 11 deletions

View File

@@ -17,17 +17,23 @@ import (
"git.rosy.net.cn/jx-callback/business/model"
)
func CreateOrder(ctx *jxcontext.Context, orderType, price int) (orderID string, err error) {
func CreateOrder(ctx *jxcontext.Context, orderType, price int, lng, lat float64) (orderID string, err error) {
var (
db = dao.GetDB()
order *model.Order
)
address, dCode, cCode, err := getAddressInfoFromCoord(db, lng, lat)
order = &model.Order{
OrderID: utils.Int64ToStr(jxutils.GenOrderNo()),
UserID: ctx.GetUserID(),
Type: orderType,
Status: model.OrderStatusWait4Pay,
PayPrice: price,
OrderID: utils.Int64ToStr(jxutils.GenOrderNo()),
UserID: ctx.GetUserID(),
Type: orderType,
Status: model.OrderStatusWait4Pay,
PayPrice: price,
Lng: lng,
Lat: lat,
Address: address,
DistrictCode: dCode,
CityCode: cCode,
}
dao.WrapAddIDCULEntity(order, ctx.GetUserName())
dao.Begin(db)