doit-cms icon indicating copy to clipboard operation
doit-cms copied to clipboard

Оптимизация потенциальных циклов в деревьях

Open ramainen opened this issue 12 years ago • 0 comments

$catalogs_ids=array(d()->this->id);
$catalogs_ids = array_merge( $catalogs_ids, d()->this->catalogs->all_of('id') ) ;
foreach(d()->this->catalogs as $catalog){
    $catalogs_ids = array_merge( $catalogs_ids, $catalog->catalogs->all_of('ids') );
}

d()->goods = d()->Good->where('catalog_id in (?)',$catalogs_ids);

ramainen avatar Oct 03 '12 11:10 ramainen