add_orderby_small_fixes
This commit is contained in:
@ -13,6 +13,7 @@ use backend\modules\company\models\Company;
|
||||
*/
|
||||
class CompanySearch extends Company
|
||||
{
|
||||
// public $status;
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@ -43,7 +44,6 @@ class CompanySearch extends Company
|
||||
public function search($params)
|
||||
{
|
||||
$query = Company::find()->joinWith('project');
|
||||
|
||||
// add conditions that should always apply here
|
||||
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
@ -69,6 +69,7 @@ class CompanySearch extends Company
|
||||
|
||||
$query->andFilterWhere(['like', 'name', $this->name])
|
||||
->andFilterWhere(['like', 'description', $this->description]);
|
||||
$query->orderBy('created_at DESC');
|
||||
|
||||
return $dataProvider;
|
||||
}
|
||||
|
@ -42,13 +42,13 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
//'description:ntext',
|
||||
//'status_id',
|
||||
[
|
||||
'attribute' => 'status',
|
||||
'attribute' => 'status_id',
|
||||
'value' => function($model){
|
||||
return isset($model->status0->name) ? $model->status0->name : 'Не задано';
|
||||
return isset($model->status->name) ? $model->status->name : 'Не задано';
|
||||
},
|
||||
'filter' => kartik\select2\Select2::widget([
|
||||
'model' => $searchModel,
|
||||
'attribute' => 'status',
|
||||
'attribute' => 'status_id',
|
||||
'data' => \common\models\Status::getStatusesArray(\common\models\UseStatus::USE_COMPANY),
|
||||
'options' => ['placeholder' => 'Начните вводить...','class' => 'form-control'],
|
||||
'pluginOptions' => [
|
||||
|
Reference in New Issue
Block a user