|
@@ -393,13 +393,13 @@ func (s *StoreEntry) DistributeFeedFormula(ctx context.Context, req *operationPb
|
|
|
}
|
|
|
|
|
|
// FeedFormulaUsage 配方使用概况
|
|
|
-func (s *StoreEntry) FeedFormulaUsage(ctx context.Context, req *operationPb.FeedFormulaUsageRequest) error {
|
|
|
+func (s *StoreEntry) FeedFormulaUsage(ctx context.Context, req *operationPb.FeedFormulaUsageRequest) (*operationPb.FeedFormulaUsageResponse, error) {
|
|
|
feedFormulaDistributeLogList := make([]*model.FeedFormulaDistributeLog, 0)
|
|
|
if err := s.DB.Model(new(model.FeedFormulaDistributeLog)).
|
|
|
Where("feed_formula_id = ?", req.FeedFormulaId).
|
|
|
Where("is_show = ?", operationPb.IsShow_OK).Group("pasture_id").
|
|
|
Find(&feedFormulaDistributeLogList).Error; err != nil {
|
|
|
- return xerr.WithStack(err)
|
|
|
+ return nil, xerr.WithStack(err)
|
|
|
}
|
|
|
|
|
|
res := &operationPb.FeedFormulaUsageResponse{
|
|
@@ -449,7 +449,7 @@ func (s *StoreEntry) FeedFormulaUsage(ctx context.Context, req *operationPb.Feed
|
|
|
}
|
|
|
|
|
|
wg.Wait()
|
|
|
- return nil
|
|
|
+ return res, nil
|
|
|
}
|
|
|
|
|
|
func (s *StoreEntry) PastureFeedFormulaIsModify(ctx context.Context, feedFormulaId int32, isModify operationPb.IsShow_Kind) {
|