diff --git a/app/admin/svc/order/svc_order_list.go b/app/admin/svc/order/svc_order_list.go index 0062b20..d91f173 100644 --- a/app/admin/svc/order/svc_order_list.go +++ b/app/admin/svc/order/svc_order_list.go @@ -216,7 +216,7 @@ func JudgePackageOrdOrdState(ord *model.Order) *model.Order { oldOrdState = ord.State ordState = oldOrdState //全部订单 - countAll, err := db.Db.Where("oid =?", ord.Oid).Count(&model.OrderGoods{}) + countAll, err := db.Db.Where("oid =? and goods_type=?", ord.Oid, 0).Count(&model.OrderGoods{}) if err != nil { return ord } @@ -229,7 +229,7 @@ func JudgePackageOrdOrdState(ord *model.Order) *model.Order { ordState = 1 } //3、判断是否有 `烘焙中` 要全部制作完成 - count2, err := db.Db.Where("oid =?", ord.Oid).And("state =?", 2).Count(&model.OrderGoods{}) + count2, err := db.Db.Where("oid =?", ord.Oid).And("state =? and goods_type=0", 2).Count(&model.OrderGoods{}) if err != nil { return ord } @@ -237,7 +237,7 @@ func JudgePackageOrdOrdState(ord *model.Order) *model.Order { ordState = 2 } //3、判断是否有 `分拣中` 要全部烘焙完成 - count3, err := db.Db.Where("oid =?", ord.Oid).And("state =?", 3).Count(&model.OrderGoods{}) + count3, err := db.Db.Where("oid =?", ord.Oid).And("state =? and goods_type=0", 3).Count(&model.OrderGoods{}) if err != nil { return ord }