Ver código fonte

更新

master
huangjiajun 5 meses atrás
pai
commit
13d1cfabe0
2 arquivos alterados com 19 adições e 1 exclusões
  1. +8
    -0
      app/db/db_order_list.go
  2. +11
    -1
      app/ipad/svc/svc_order_make.go

+ 8
- 0
app/db/db_order_list.go Ver arquivo

@@ -16,6 +16,14 @@ func GetOrderById(eg *xorm.Engine, id string) *model.Order {
}
return &order
}
func GetOrderByIds(eg *xorm.Engine, id []string) *[]model.Order {
var order []model.Order
err := eg.In("oid", id).Find(&order)
if err != nil {
return nil
}
return &order
}
func GetOrderByIdSess(sess *xorm.Session, id string) *model.Order {
var order model.Order
get, err := sess.Where("oid=?", id).Get(&order)


+ 11
- 1
app/ipad/svc/svc_order_make.go Ver arquivo

@@ -1,6 +1,7 @@
package svc

import (
"applet/app/admin/svc/order"
"applet/app/db"
"applet/app/db/model"
"applet/app/e"
@@ -41,7 +42,9 @@ func NewOrderSortingEnd(c *gin.Context) {
defer sess.Close()
sess.Begin()
//修改制作记录
oids := make([]string, 0)
for _, v := range args.OrderInfo {
oids = append(oids, v["oid"])
record := db.GetOrderGoods(sess, v["oid"], args.Gid, args.SkuId)
if record.MakeDate > utils.StrToInt(time.Now().Format("20060102")) {
sess.Rollback()
@@ -98,8 +101,15 @@ func NewOrderSortingEnd(c *gin.Context) {
return
}
}

sess.Commit()
if len(oids) > 0 {
ord := db.GetOrderByIds(eg, oids)
if ord != nil {
for _, v := range *ord {
order.JudgePackageOrdOrdState(&v)
}
}
}
e.OutSuc(c, "success", nil)
return
}


Carregando…
Cancelar
Salvar