$query->registerRuntimeField("store",[
"data_type" => "\Bitrix\Catalog\StoreProductTable",
'reference' => [
'this.ID' => 'ref.PRODUCT_ID'
],
]);
$query->registerRuntimeField("DETAIL_AMOUNT",[
"data_type" => "integer",
"expression" => array("sum(%s)", "store.AMOUNT")
]);
public function boot(Dispatcher $events)
{
$events->listen(BuildingMenu::class, function (BuildingMenu $event) {
$event->menu->add('MAIN NAVIGATION');
$event->menu->add([
'text' => 'Объявления',
'url' => 'admin/offers',
'icon' => 'far fa-fw fa-file',
'label' => DB::table('offers')->where('new',true)->count(),
'label_color' => 'success',
]);
});
}