params['ptStyle'] = dict::getDict('ptStyle', 'ghs'); if (getenv('YII_ENV') == 'production') { $toShopId = 33904; $fromShopId = 12526; } else { $toShopId = 36677; $fromShopId = 36523; } $fromCustomList = CustomClass::getAllByCondition(['ownShopId' => $fromShopId], null, '*'); foreach ($fromCustomList as $fromCustomer) { $exist = CustomClass::exists(['ownShopId' => $toShopId, 'shopId' => $fromCustomer['shopId']]); if (!$exist) { CustomClass::build($toShopId, $fromCustomer['shopId'], $fromCustomer['name']); } } } }