fix search gyn
parent
a65155a652
commit
8ca76749c8
|
|
@ -34,7 +34,14 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||||
'model' => $searchModel,
|
'model' => $searchModel,
|
||||||
'theme' => Select2::THEME_BOOTSTRAP,
|
'theme' => Select2::THEME_BOOTSTRAP,
|
||||||
'attribute' => 'specimen_adequacy_1',
|
'attribute' => 'specimen_adequacy_1',
|
||||||
'data' => ArrayHelper::map(CytoSpecimenAdequacy1::find()->all(), 'id', 'name'),
|
'data' => ArrayHelper::map(
|
||||||
|
CytoSpecimenAdequacy1::find()
|
||||||
|
->where(['status' => 1])
|
||||||
|
->andWhere(['type' => 'pap'])
|
||||||
|
->all(),
|
||||||
|
'id',
|
||||||
|
'name'
|
||||||
|
),
|
||||||
'options' => ['placeholder' => 'เลือก Specimen Adequacy 1...'],
|
'options' => ['placeholder' => 'เลือก Specimen Adequacy 1...'],
|
||||||
'pluginOptions' => [
|
'pluginOptions' => [
|
||||||
'allowClear' => true,
|
'allowClear' => true,
|
||||||
|
|
@ -122,9 +129,6 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||||
'adequacy_other',
|
'adequacy_other',
|
||||||
[
|
[
|
||||||
'attribute' => 'general_categorization_1',
|
'attribute' => 'general_categorization_1',
|
||||||
'label' => 'General Categorization 1',
|
|
||||||
'format' => 'raw',
|
|
||||||
//'filter' => ArrayHelper::map(CytoGeneralCategorization1::find()->all(), 'id', 'name'),
|
|
||||||
'filter' => Select2::widget([
|
'filter' => Select2::widget([
|
||||||
'model' => $searchModel,
|
'model' => $searchModel,
|
||||||
'theme' => Select2::THEME_BOOTSTRAP,
|
'theme' => Select2::THEME_BOOTSTRAP,
|
||||||
|
|
@ -137,17 +141,16 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||||
]),
|
]),
|
||||||
'filterInputOptions' => ['id' => null], // ป้องกัน id ซ้ำใน grid หลายแถว
|
'filterInputOptions' => ['id' => null], // ป้องกัน id ซ้ำใน grid หลายแถว
|
||||||
'value' => function ($model) {
|
'value' => function ($model) {
|
||||||
if (!empty($model->general_categorization_1) && is_array($model->general_categorization_1)) {
|
$generals1 = CytoGeneralCategorization1::find()
|
||||||
$gc1 = '<ul>';
|
//->where(['type' => 'pap'])
|
||||||
foreach ($model->general_categorization_1 as $general) {
|
->all();
|
||||||
$general1 = CytoGeneralCategorization1::find()->where(['id' => $general])->one();
|
|
||||||
$gc1 .= '<li>' . $general1->name . '</li>';
|
$generalMap1 = [];
|
||||||
}
|
foreach ($generals1 as $general1) {
|
||||||
$gc1 .= '</ul>';
|
$generalMap1[$general1->id] = $general1->name;
|
||||||
return $gc1;
|
|
||||||
} else {
|
|
||||||
return '';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return isset($generalMap1[$model->general_categorization_1]) ? $generalMap1[$model->general_categorization_1] : '';
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue