Browse Source

1配置

master
huangjiajun 7 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"
"fmt"
"github.com/gin-gonic/gin"
"strings"
"time"
"xorm.io/xorm"
)
@@ -51,6 +52,7 @@ func GoodsPayCreate(c *gin.Context) {
BuyPhone: req.BuyInfo.Phone,
Amount: utils.Float64ToStr(amount),
State: 1,
Date: utils.StrToInt(strings.ReplaceAll(req.BuyInfo.Date, "-", "")),
}
one, err := sess.InsertOne(&order)
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"] != "" {
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"] != "" {
var enterprise []model.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"`
CancelAt time.Time `json:"cancel_at" xorm:"comment('取消时间') DATETIME"`
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)"`
Amount string `json:"amount" xorm:"default 0.00 comment('付款金额') DECIMAL(20,2)"`
BuyPhone string `json:"buy_phone" xorm:"comment('购买人手机') VARCHAR(20)"`


Loading…
Cancel
Save