|
|
@@ -22,7 +22,6 @@ func AddOrder(eg *xorm.Engine, req map[string]string) { |
|
|
|
if minMOneyData != nil { |
|
|
|
minMOney = zhios_order_relate_utils.StrToFloat64(minMOneyData.Val) |
|
|
|
} |
|
|
|
price := zhios_order_relate_utils.StrToFloat64(req["price"]) |
|
|
|
req["price"] = zhios_order_relate_utils.Float64ToStrByPrec(zhios_order_relate_utils.StrToFloat64(req["price"])*capitalPoolMul, 2) |
|
|
|
if req["type"] == "mall_goods_user_lv" { |
|
|
|
for i := 0; i < zhios_order_relate_utils.StrToInt(req["num"]); i++ { |
|
|
@@ -38,7 +37,7 @@ func AddOrder(eg *xorm.Engine, req map[string]string) { |
|
|
|
eg.Insert(data) |
|
|
|
} |
|
|
|
} else { |
|
|
|
getPrice(eg, req, minMOney*capitalPoolMul, price) |
|
|
|
getPrice(eg, req, minMOney*capitalPoolMul, zhios_order_relate_utils.StrToFloat64(req["price"])) |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
@@ -106,14 +105,14 @@ func Pool(eg *xorm.Engine, price string) error { |
|
|
|
} |
|
|
|
//统计数量 |
|
|
|
//礼包的 |
|
|
|
sql := `SELECT SUM(num) as sum,uid FROM mall_ord_capital_pool_total WHERE leave_price>0 GROUP BY uid;` |
|
|
|
sql := `SELECT SUM(num) as sum,uid FROM mall_ord_capital_pool_total WHERE leave_price>0 and num>0 GROUP BY uid;` |
|
|
|
nativeString, err := db.QueryNativeStringSess(session, sql) |
|
|
|
if err != nil { |
|
|
|
session.Rollback() |
|
|
|
|
|
|
|
return err |
|
|
|
} |
|
|
|
sqlFirst := `SELECT uid FROM mall_ord_capital_pool_total WHERE 1=1 GROUP BY uid;` |
|
|
|
sqlFirst := `SELECT uid FROM mall_ord_capital_pool_total WHERE 1=1 and num>0 GROUP BY uid;` |
|
|
|
nativeStringFirst, errFirst := db.QueryNativeStringSess(session, sqlFirst) |
|
|
|
if errFirst != nil { |
|
|
|
session.Rollback() |
|
|
@@ -147,7 +146,7 @@ func Pool(eg *xorm.Engine, price string) error { |
|
|
|
//读取用户的记录 |
|
|
|
var leave float64 = 0 |
|
|
|
var data []model.MallOrdCapitalPoolTotal |
|
|
|
err := session.Where("uid=? and leave_price>?", v, 0).Find(&data) |
|
|
|
err := session.Where("uid=? and leave_price>? and num>?", v, 0, 0).Find(&data) |
|
|
|
if err != nil { |
|
|
|
session.Rollback() |
|
|
|
return err |
|
|
|