$result = \Bitrix\Catalog\StoreProductTable::getList([
'select' => [
'PRODUCT_ID',
'STORE_ID',
// если надо сразу инфу по складу
//'STORE.*',
],
'filter' => [
'@PRODUCT_ID' => $productIds,
'>AMOUNT' => 0,
],
]);
$productStores = $result->fetchAll();
if (is_array($v)) {
array_walk_recursive_array($v, $callback);
function array_walk_recursive_array(array &$array, callable $callback) {
foreach ($array as $k => &$v) {
// if (is_array($v)) {
// array_walk_recursive_array($v, $callback);
// } else {
$callback(& $v, $k, $array);
// }
}
}
array_walk_recursive_array( $array, function( $v, $k, $array ) {
if ( is_array( $v ) ) {
$v = $v['a'] = 'b';
return $v;
}
else return $v;
});
$arr1ids = array_column($arr1, 'id');
$arr2ids = array_column($arr2, 'id');
$intersecIds = array_intersect($arr1ids, $arr2ids);
$arr1inArr2 = array_filter($arr1, function(array $item) use($intersecIds) {
return in_array($item['id'], $intersecIds);
});
Тем более я застрял на уровне 2005-го года, когда был PHP 5.3
trait GameSearchStatus
{
public function fillGameSearch(ActiveQuery $query, array $params)
{
$gameSearch = $params['GameSearch'] ?? null;
if (is_array($gameSearch) && !isset($gameSearch['all'])) {
foreach ($gameSearch as $key => $value) {
if (!empty($value)) {
$query->where([
$key => $value,
]);
break;
}
}
}
}
}