Commit 330cee17 authored by john's avatar john

3010

parent 6a54644e
......@@ -49,7 +49,10 @@ class SearchDocList extends DocList
$idListInt[] = (int) $_id;
$query = DocList::find();
$query->joinWith(['lang']);
$query->orderBy([ new \yii\db\Expression('FIELD (`doc_list`.`id`, ' . implode(',', $idListInt) . ')')]);
$sort = yii::$app->request->get('sort');
if (!$sort)
$query->orderBy([new \yii\db\Expression('FIELD (`doc_list`.`id`, ' . implode(',', $idListInt) . ')')]);
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort' => [
......
......@@ -28,10 +28,12 @@ $parentList = $searchModel->getParentList($searchModel, 0, 0, true);
],
[
'attribute' => 'name',
'format'=>'raw',
'format' => 'raw',
'value' => function($model)use($parentList) {
return '<p style="white-space: nowrap;">'.$parentList[$model->id . ' '].'</p>';
// return $model->lang->name;
$sort = yii::$app->request->get('sort');
if (!$sort)
return '<p style="white-space: nowrap;">' . $parentList[$model->id . ' '] . '</p>';
return $model->lang->name;
}
],
[
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment