|
@@ -1025,13 +1025,13 @@ func (s *StoreEntry) checkoutDistributeData(ctx context.Context, req *operationP
|
|
|
result.PastureList = model.GroupPastureSlice(newGroupPastureList).ToPB()
|
|
|
|
|
|
newFeedFormulaList := make([]*model.FeedFormula, 0)
|
|
|
- if err := s.DB.Model(new(model.FeedFormula)).Where("id IN ?", req.FeedFormulaIds).Find(&newFeedFormulaList).Error; err != nil {
|
|
|
+ if err := s.DB.Model(new(model.FeedFormula)).Where("id IN ?", req.FeedFormulaIds).Where("is_show = ?", operationPb.IsShow_OK).Find(&newFeedFormulaList).Error; err != nil {
|
|
|
return result, xerr.WithStack(err)
|
|
|
}
|
|
|
result.FeedFormulaList = model.FeedFormulaSlice(newFeedFormulaList).ToDistributePB()
|
|
|
|
|
|
if len(result.FeedFormulaList) != len(req.FeedFormulaIds) {
|
|
|
- return result, xerr.Customf("数据错误:%v", req.FeedFormulaIds)
|
|
|
+ return result, xerr.Customf("有禁用的配方数据或者数据错误")
|
|
|
}
|
|
|
|
|
|
for _, v := range result.FeedFormulaList {
|