M
M
microf2017-10-07 09:27:01
1C-Bitrix
microf, 2017-10-07 09:27:01

How to display data in the admin panel?

There is a site on Bitrix, in which the user receives points for some specific actions - for example, for registration. Points are shown in the user's personal account using

$bonus = 0;
$arSelect = Array("ID", "PROPERTY_BAL");				 
$arFilter = Array("IBLOCK_ID"=>9, "ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y","PROPERTY_USER"=>$USER->GetID());
$res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>50), $arSelect);
while($ob = $res->GetNextElement())
{
 $arFields = $ob->GetFields();
  $bonus += $arFields["PROPERTY_BAL_VALUE"];
}
$rsUser = CUser::GetByID($USER->GetID());
$arUser = $rsUser->Fetch();

I would like the user's points to be shown in the admin panel in the "list of users". Where should I add the above code so that it is reflected in the list of users? How in general should such things be solved in Bitrix? What class should be extended?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Nikolaev, 2017-10-09
@gromdron

Well, there is one option:
- Create a custom field of type "number" without user editing rights
- Write code that, when adding / deleting / updating an element, sets the value of the field to the corresponding value if the points date has not expired
- Write an agent that receives elements every day information block of points that expired yesterday and updates the user data for the current date

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question