Browse Source

1配置

master
huangjiajun 6 months ago
parent
commit
78998e29a0
3 changed files with 7 additions and 0 deletions
  1. +2
    -0
      app/admin/svc/order/svc_order_pay.go
  2. +4
    -0
      app/db/db_order_list.go
  3. +1
    -0
      app/db/model/order.go

+ 2
- 0
app/admin/svc/order/svc_order_pay.go View File

@@ -11,6 +11,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"strings"
"time" "time"
"xorm.io/xorm" "xorm.io/xorm"
) )
@@ -51,6 +52,7 @@ func GoodsPayCreate(c *gin.Context) {
BuyPhone: req.BuyInfo.Phone, BuyPhone: req.BuyInfo.Phone,
Amount: utils.Float64ToStr(amount), Amount: utils.Float64ToStr(amount),
State: 1, State: 1,
Date: utils.StrToInt(strings.ReplaceAll(req.BuyInfo.Date, "-", "")),
} }
one, err := sess.InsertOne(&order) one, err := sess.InsertOne(&order)
if one == 0 || err != nil { if one == 0 || err != nil {


+ 4
- 0
app/db/db_order_list.go View File

@@ -60,6 +60,10 @@ func GetOrderList(eg *xorm.Engine, param map[string]string) (*[]model.Order, int
if param["end_at"] != "" { if param["end_at"] != "" {
sess.And("create_at <= ?", param["end_at"]) sess.And("create_at <= ?", param["end_at"])
} }
if param["date"] != "" {
param["date"] = strings.ReplaceAll(param["date"], "-", "")
sess.And("date = ?", param["date"])
}
if param["enterprise_name"] != "" { if param["enterprise_name"] != "" {
var enterprise []model.Enterprise var enterprise []model.Enterprise
eg.Where("name like ?", "%"+param["enterprise_name"]+"%").Find(&enterprise) eg.Where("name like ?", "%"+param["enterprise_name"]+"%").Find(&enterprise)


+ 1
- 0
app/db/model/order.go View File

@@ -11,6 +11,7 @@ type Order struct {
CreateAt time.Time `json:"create_at" xorm:"comment('下单时间') DATETIME"` CreateAt time.Time `json:"create_at" xorm:"comment('下单时间') DATETIME"`
CancelAt time.Time `json:"cancel_at" xorm:"comment('取消时间') DATETIME"` CancelAt time.Time `json:"cancel_at" xorm:"comment('取消时间') DATETIME"`
EnterpriseId int `json:"enterprise_id" xorm:"default 0 comment('校企id') INT(11)"` EnterpriseId int `json:"enterprise_id" xorm:"default 0 comment('校企id') INT(11)"`
Date int `json:"date" xorm:"default 0 comment('校企id') INT(11)"`
BuyInfo string `json:"buy_info" xorm:"comment('购买人信息 json') VARCHAR(2000)"` BuyInfo string `json:"buy_info" xorm:"comment('购买人信息 json') VARCHAR(2000)"`
Amount string `json:"amount" xorm:"default 0.00 comment('付款金额') DECIMAL(20,2)"` Amount string `json:"amount" xorm:"default 0.00 comment('付款金额') DECIMAL(20,2)"`
BuyPhone string `json:"buy_phone" xorm:"comment('购买人手机') VARCHAR(20)"` BuyPhone string `json:"buy_phone" xorm:"comment('购买人手机') VARCHAR(20)"`


Loading…
Cancel
Save