Merge pull request 'Add znzt module' (#120) from fix-permissions into main
Deploy / deploy (push) Failing after 2m59s Details

Reviewed-on: https://72.56.235.246.nip.io/gitea/romanskijdev/ruspet_portal_back/pulls/120
This commit is contained in:
romanskijdev 2026-08-27 12:48:43 +03:00
commit e73f03bf51
1 changed files with 10 additions and 1 deletions

View File

@ -75,10 +75,19 @@ func (s *MonthlyOrderService) GetMyOrderData(ctx context.Context, managerID uint
}
// 3. Достаем черновики из нашей БД
// (Предполагается, что вы добавите метод GetClientOrdersByManagerDB в dbcore)
dbOrders, _ := s.ipc.Database.MonthlyOrders.GetClientOrdersByManagerDB(ctx, managerID, month, year)
ordersMap := make(map[string]*typescore.MonthlyOrderClient)
for _, o := range dbOrders {
if o.ID != nil {
items, err := s.ipc.Database.MonthlyOrders.GetItemsByOrderIDDB(ctx, *o.ID)
if err == nil && len(items) > 0 {
for _, item := range items {
o.Items = append(o.Items, *item)
}
}
}
if o.ClientName != nil {
ordersMap[*o.ClientName] = o
}