作者 tangxvhui

Merge branch 'dev' into test

@@ -97,13 +97,13 @@ func (repository OrderGoodRepository) Find(queryOption domain.OrderGoodFindQuery @@ -97,13 +97,13 @@ func (repository OrderGoodRepository) Find(queryOption domain.OrderGoodFindQuery
97 if queryOption.Limit > 0 { 97 if queryOption.Limit > 0 {
98 query = query.Limit(queryOption.Limit) 98 query = query.Limit(queryOption.Limit)
99 } else { 99 } else {
100 - query = query.Limit(50) 100 + query = query.Limit(100)
101 } 101 }
102 var ( 102 var (
103 err error 103 err error
104 orderGoods = make([]domain.OrderGood, 0) 104 orderGoods = make([]domain.OrderGood, 0)
105 ) 105 )
106 - query = query.Order("order_good.id DESC") 106 + query = query.Order("order_good.id")
107 count, err := query.SelectAndCount() 107 count, err := query.SelectAndCount()
108 if err != nil { 108 if err != nil {
109 return orderGoods, 0, err 109 return orderGoods, 0, err
@@ -191,6 +191,9 @@ func (postData postPurposeOrderDetail) Valid() error { @@ -191,6 +191,9 @@ func (postData postPurposeOrderDetail) Valid() error {
191 if len(postData.OrderDist) == 0 { 191 if len(postData.OrderDist) == 0 {
192 return lib.ThrowError(lib.ARG_ERROR, "订单区域必填") 192 return lib.ThrowError(lib.ARG_ERROR, "订单区域必填")
193 } 193 }
  194 + if len(postData.Product) > 50 {
  195 + return lib.ThrowError(lib.ARG_ERROR, "货品列表最多50项")
  196 + }
194 for i := range postData.Product { 197 for i := range postData.Product {
195 if err := postData.Product[i].Valid(); err != nil { 198 if err := postData.Product[i].Valid(); err != nil {
196 return err 199 return err