Commit 684adb13 by san58

правка списка результирующих доменов

1 parent ab1f4534
...@@ -10,6 +10,7 @@ use yii\db\Expression; ...@@ -10,6 +10,7 @@ use yii\db\Expression;
use yii\helpers\Console; use yii\helpers\Console;
use app\components\Collection; use app\components\Collection;
use app\models\Host; use app\models\Host;
use app\models\Filter;
/** /**
* Парсинг запрещенных ресурсов в РФ. * Парсинг запрещенных ресурсов в РФ.
...@@ -45,6 +46,7 @@ class WhoisController extends Controller ...@@ -45,6 +46,7 @@ class WhoisController extends Controller
->select('id, domain') ->select('id, domain')
->from('{{%host}}') ->from('{{%host}}')
->where(['in', 'wis_status', [Host::STATUS_WIS_NONE, Host::STATUS_WIS_BUSY]]) ->where(['in', 'wis_status', [Host::STATUS_WIS_NONE, Host::STATUS_WIS_BUSY]])
->andWhere(['status'=> Filter::STATUS_ON])
->orderBy('rand()') ->orderBy('rand()')
->limit($this->count) ->limit($this->count)
->all(); ->all();
......
...@@ -46,8 +46,11 @@ class HostFreeController extends Controller ...@@ -46,8 +46,11 @@ class HostFreeController extends Controller
*/ */
public function actionIndex() public function actionIndex()
{ {
$searchModel = new HostSearch(['wis_status' => Host::STATUS_WIS_FREE, 'status' => Filter::STATUS_ON ]); /*'wis_status' => Host::STATUS_WIS_FREE, 'status' => Filter::STATUS_ON */
$dataProvider = $searchModel->search(Yii::$app->request->queryParams); $params = Yii::$app->request->queryParams;
$params['wis_status']=Host::STATUS_WIS_FREE;
$searchModel = new HostSearch();
$dataProvider = $searchModel->search($params);
return $this->render('index', [ return $this->render('index', [
'searchModel' => $searchModel, 'searchModel' => $searchModel,
......
...@@ -56,6 +56,8 @@ class HostSearch extends Host ...@@ -56,6 +56,8 @@ class HostSearch extends Host
return $dataProvider; return $dataProvider;
} }
var_dump($this->wis_status);
die;
// grid filtering conditions // grid filtering conditions
$query->andFilterWhere([ $query->andFilterWhere([
'id' => $this->id, 'id' => $this->id,
...@@ -63,7 +65,7 @@ class HostSearch extends Host ...@@ -63,7 +65,7 @@ class HostSearch extends Host
//'csv_date' => $this->csv_date, //'csv_date' => $this->csv_date,
//'wis_date' => $this->wis_date, //'wis_date' => $this->wis_date,
'wis_status' => $this->wis_status, 'wis_status' => $this->wis_status,
'domain_expire' => $this->wis_status, //'domain_expire' => $this->domain_expire,
'tix' => $this->tix, 'tix' => $this->tix,
'status' => $this->status 'status' => $this->status
]); ]);
......
...@@ -19,7 +19,7 @@ use app\models\Filter; ...@@ -19,7 +19,7 @@ use app\models\Filter;
<?= $form->field($model, 'include', ['options' => ['class' => 'form-group col-xs-12']])->dropDownList(Filter::getIncludes()) ?> <?= $form->field($model, 'include', ['options' => ['class' => 'form-group col-xs-12']])->dropDownList(Filter::getIncludes()) ?>
<?= $form->field($model, 'status', ['options' => ['class' => 'form-group col-xs-12']])->dropDownList(Filter::getWisStatus()) ?> <?= $form->field($model, 'status', ['options' => ['class' => 'form-group col-xs-12']])->dropDownList(Filter::getStatus()) ?>
<?= $form->field($model, 'type', ['options' => ['class' => 'form-group col-xs-12']])->dropDownList(Filter::getTypes()) ?> <?= $form->field($model, 'type', ['options' => ['class' => 'form-group col-xs-12']])->dropDownList(Filter::getTypes()) ?>
......
...@@ -38,7 +38,7 @@ $this->params['breadcrumbs'][] = $this->title; ...@@ -38,7 +38,7 @@ $this->params['breadcrumbs'][] = $this->title;
], ],
[ [
'attribute' => 'status', 'attribute' => 'status',
'value' => $model::getWisStatus($model->status), 'value' => $model::getStatus($model->status),
], ],
[ [
'attribute' => 'type', 'attribute' => 'type',
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!