J
J
jorshjorsh952018-07-24 10:22:10
1C-Bitrix
jorshjorsh95, 2018-07-24 10:22:10

How to get the maximum and minimum price in the Infoblock?

Good afternoon.
You need to get the maximum and minimum price and a couple of similar parameters in a certain section of the infoblock.
So far I only have 2 options:

1. 2 раза GetList, с максимальной и минимальной сортировкой по полю достать 1 элемент.
2. собственный sql запрос

But I am more than sure that in Bitrix it can be implemented without such crutches.
Please tell me how to implement it

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Emelyanov, 2018-07-24
@jorshjorsh95

The first option on your list. Just set nTopCount=1

A
Alex-1917, 2018-07-24
@alex-1917

Make a getlist, ONCE, sorting by price right there, you will get an array, you drag the base price from it through explode and that's it !!)
the first element of the array will be the minimum salary, the last - the maximum salary))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question