Skip to content

Commit

Permalink
Revmove dev strings
Browse files Browse the repository at this point in the history
  • Loading branch information
tafid committed Jan 14, 2016
1 parent 2e3981f commit d4555b5
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/controllers/DomainController.php
Original file line number Diff line number Diff line change
Expand Up @@ -575,29 +575,29 @@ public function actionCheck()
$line['domain'] = $domainName;
$line['zone'] = $zone;
if ($domain) {
// $check = Domain::perform('Check', ['domains' => [$domain]], true);
$check = [$domain => mt_rand(0,1)]; // todo: remove this line
sleep(mt_rand(0,2));
$check = Domain::perform('Check', ['domains' => [$domain]], true);
// $check = [$domain => mt_rand(0,1)]; // todo: remove this line
// sleep(mt_rand(0,2));
if ($check[$domain] === 0) {
return $this->renderAjax('_checkDomainLine', [
'line' => $line,
'state' => 'unavailable'
]);
} else {
// $tariffs = Tariff::find(['scenario' => 'get-available-info'])
// ->joinWith('resources')
// ->andFilterWhere(['type' => 'domain'])
// ->andFilterWhere(['seller' => 'ahnames'])
// ->one();
// $zones = array_filter($tariffs->resources ?: [], function ($resource) {
// return ($resource->zone !== null && $resource->type === Resource::TYPE_DOMAIN_REGISTRATION);
// });
// foreach ($zones as $resource) {
// if ($resource->zone === $line['zone']) {
// $line['tariff'] = $resource;
// break;
// }
// }
$tariffs = Tariff::find(['scenario' => 'get-available-info'])
->joinWith('resources')
->andFilterWhere(['type' => 'domain'])
->andFilterWhere(['seller' => 'ahnames'])
->one();
$zones = array_filter($tariffs->resources ?: [], function ($resource) {
return ($resource->zone !== null && $resource->type === Resource::TYPE_DOMAIN_REGISTRATION);
});
foreach ($zones as $resource) {
if ($resource->zone === $line['zone']) {
$line['tariff'] = $resource;
break;
}
}

return $this->renderAjax('_checkDomainLine', [
'line' => $line,
Expand Down

0 comments on commit d4555b5

Please sign in to comment.