|
|
@@ -800,8 +800,11 @@ func OrderUpdateState(c *gin.Context) { |
|
|
|
|
|
|
|
sess4.Where("sku_id=? and gid=? and make_date=?", v.SkuId, v.GoodsId, v.MakeDate).Find(&flow) |
|
|
|
for _, v1 := range flow { |
|
|
|
v1.SuccessNum += v1.WaitSortingNum |
|
|
|
v1.WaitSortingNum = 0 |
|
|
|
v1.SuccessNum += v.Num |
|
|
|
v1.WaitSortingNum -= v.Num |
|
|
|
if v1.WaitSortingNum < 0 { |
|
|
|
v1.WaitSortingNum = 0 |
|
|
|
} |
|
|
|
sess5 := sess |
|
|
|
_, err = sess5.Where("id=?", v1.Id).Cols("success_num,wait_sorting_num").Update(&v1) |
|
|
|
if err != nil { |
|
|
|