add rfid_key to card and key
This commit is contained in:
@@ -23,7 +23,7 @@ class CardSearch extends Card
|
||||
{
|
||||
return [
|
||||
[['id_card', 'status', 'type'], 'integer'],
|
||||
[[ 'searchCustomerName', 'number', 'created_at', 'updated_at'], 'safe'],
|
||||
[[ 'searchCustomerName', 'number','rfid_key', 'created_at', 'updated_at'], 'safe'],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ class CardSearch extends Card
|
||||
]);
|
||||
|
||||
$query->andFilterWhere(['like', 'card.number', $this->number]);
|
||||
$query->andFilterWhere(['like', 'card.rfid_key', $this->rfid_key]);
|
||||
$query->andFilterWhere(['like', 'customer.name', $this->searchCustomerName]);
|
||||
|
||||
return $dataProvider;
|
||||
|
||||
@@ -20,7 +20,8 @@ class KeySearch extends Key
|
||||
return [
|
||||
/*[['id_key', 'status', 'type'], 'integer'],
|
||||
[['number', 'created_at', 'updated_at'], 'safe'],*/
|
||||
[['number'], 'safe']
|
||||
[['number'], 'safe'],
|
||||
[['rfid_key'], 'safe']
|
||||
];
|
||||
}
|
||||
|
||||
@@ -59,6 +60,7 @@ class KeySearch extends Key
|
||||
$query->andFilterWhere([
|
||||
'id_key' => $this->id_key,
|
||||
'number' => $this->number,
|
||||
'rfid_key' => $this->rfid_key,
|
||||
'status' => $this->status,
|
||||
'type' => $this->type,
|
||||
'created_at' => $this->created_at,
|
||||
|
||||
@@ -14,6 +14,7 @@ use common\models\Card;
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'number')->textInput(['maxlength' => true]) ?>
|
||||
<?= $form->field($model, 'rfid_key')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<?= $form->field($model, 'status')->dropDownList(Card::statuses()) ?>
|
||||
|
||||
|
||||
@@ -46,6 +46,9 @@ $statusOptions = mkOptions(Card::statuses());
|
||||
<div class='col-md-3'>
|
||||
<?= $form->field($model, 'searchCustomerName')->textInput() ?>
|
||||
</div>
|
||||
<div class='col-md-3'>
|
||||
<?= $form->field($model, 'rfid_key')->textInput() ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -28,6 +28,10 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'attribute' => 'number',
|
||||
'value' => 'number'
|
||||
],
|
||||
[
|
||||
'attribute' => 'rfid_key',
|
||||
'value' => 'rfid_key'
|
||||
],
|
||||
[
|
||||
'attribute' => 'status',
|
||||
'value' => 'statusHuman'
|
||||
|
||||
@@ -22,6 +22,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'number',
|
||||
'rfid_key',
|
||||
['attribute' => 'status', 'value' => $model->statusHuman],
|
||||
['attribute' => 'type', 'value' => $model->typeHuman],
|
||||
'created_at:datetime',
|
||||
|
||||
@@ -14,6 +14,7 @@ use common\models\Key;
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'number')->textInput(['maxlength' => true]) ?>
|
||||
<?= $form->field($model, 'rfid_key')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<?= $form->field($model, 'status')->dropDownList( Key::statuses() ) /*->textInput()*/ ?>
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@ use common\models\Key;
|
||||
|
||||
<div class="key-search">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
@@ -20,8 +18,14 @@ use common\models\Key;
|
||||
]); ?>
|
||||
|
||||
<?php //echo $form->field($model, 'id_key') ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<?php echo $form->field($model, 'number') ?>
|
||||
</div><!-- col-md-4 END -->
|
||||
<div class="col-md-4">
|
||||
<?php echo $form->field($model, 'rfid_key') ?>
|
||||
</div><!-- col-md-4 END -->
|
||||
</div><!-- row END -->
|
||||
<?php //$form->field($model, 'status')->dropDownList( Key::statuses() ) /*->textInput()*/ ?>
|
||||
|
||||
<?php //echo $form->field($model, 'status') ?>
|
||||
@@ -39,6 +43,4 @@ use common\models\Key;
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div><!-- col-md-4 END -->
|
||||
</div><!-- row END -->
|
||||
</div>
|
||||
|
||||
@@ -30,6 +30,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
// ['class' => 'yii\grid\SerialColumn'],
|
||||
// 'id_key',
|
||||
'number',
|
||||
'rfid_key',
|
||||
[
|
||||
'attribute' => 'status',
|
||||
'value' => function ($model, $key, $index, $column){
|
||||
@@ -39,7 +40,11 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
}
|
||||
],
|
||||
//'status',
|
||||
'type',
|
||||
[
|
||||
'attribute' =>'type',
|
||||
'value' =>'humanType'
|
||||
|
||||
],
|
||||
'created_at',
|
||||
// 'updated_at',
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'attributes' => [
|
||||
'id_key',
|
||||
'number',
|
||||
'rfid_key',
|
||||
'status',
|
||||
'type',
|
||||
'created_at',
|
||||
|
||||
Reference in New Issue
Block a user