|
|
@@ -2,6 +2,7 @@ package order_controller
|
|
|
|
|
|
import (
|
|
|
"fmt"
|
|
|
+ "fohow.com/apps/models/base_config"
|
|
|
"fohow.com/libs/lib_redis"
|
|
|
// "fmt"
|
|
|
"strconv"
|
|
|
@@ -81,8 +82,8 @@ func (self *OrderController) Create() {
|
|
|
if wxUId == 76 {
|
|
|
totalPrice = 1
|
|
|
}
|
|
|
- freight := order_model.FREIGHT
|
|
|
- if totalPrice >= order_model.FREIGHT_LIMIT || beego.AppConfig.String("RunMode") == "dev" {
|
|
|
+ freight := base_config.GetFreight()
|
|
|
+ if totalPrice >= base_config.GetOrderLimit() {
|
|
|
freight = int64(0)
|
|
|
}
|
|
|
|
|
|
@@ -164,8 +165,8 @@ func (self *OrderController) MultipleCreate() {
|
|
|
totalPrice += product.Price * cNums
|
|
|
CreateOrderDetails(product, order, cNums)
|
|
|
}
|
|
|
- freight := order_model.FREIGHT
|
|
|
- if totalPrice >= order_model.FREIGHT_LIMIT || beego.AppConfig.String("RunMode") == "dev" {
|
|
|
+ freight := base_config.GetFreight()
|
|
|
+ if totalPrice >= base_config.GetOrderLimit() {
|
|
|
freight = int64(0)
|
|
|
}
|
|
|
order.TotalPrice = totalPrice
|
|
|
@@ -223,8 +224,8 @@ func (self *OrderController) MultShopCreate() {
|
|
|
totalPrice += product.Price * cNums
|
|
|
CreateOrderDetails(product, order, cNums)
|
|
|
}
|
|
|
- freight := order_model.FREIGHT
|
|
|
- if totalPrice >= order_model.FREIGHT_LIMIT || beego.AppConfig.String("RunMode") == "dev" {
|
|
|
+ freight := base_config.GetFreight()
|
|
|
+ if totalPrice >= base_config.GetOrderLimit() {
|
|
|
freight = int64(0)
|
|
|
}
|
|
|
order.TotalPrice = totalPrice
|
|
|
@@ -281,13 +282,9 @@ func (self *OrderController) MultCentCreate() {
|
|
|
totalPrice += product.Price * cNums
|
|
|
CreateOrderDetails(product, order, cNums)
|
|
|
}
|
|
|
- freight := order_model.FREIGHT
|
|
|
- if totalPrice < order_model.CENT_LIMIT {
|
|
|
- self.ReturnError(403, []string{apps.OrderNotEnough[0], fmt.Sprintf("订单最低金额%d", order_model.CENT_LIMIT)}, "", nil)
|
|
|
- }
|
|
|
-
|
|
|
- if totalPrice < order_model.CENT_LIMIT || beego.AppConfig.String("RunMode") == "dev" {
|
|
|
- freight = int64(0)
|
|
|
+ freight := base_config.GetFreight()
|
|
|
+ if totalPrice < base_config.GetOrderLimit() {
|
|
|
+ self.ReturnError(403, []string{apps.OrderNotEnough[0], fmt.Sprintf("订单最低金额%d", base_config.GetOrderLimit())}, "", nil)
|
|
|
}
|
|
|
order.TotalPrice = totalPrice
|
|
|
order.Freight = freight
|