Add key controller to add/update keys , add bakcend skin param
This commit is contained in:
@@ -41,7 +41,16 @@ class KeyToggleForm extends Model
|
||||
}
|
||||
|
||||
public function toggleKey(){
|
||||
$this->keyModel = Key::find()->andWhere(['rfid_key' => $this->key])->one();
|
||||
$query= Key::find();
|
||||
|
||||
$query->andWhere(['or',
|
||||
['and',[ 'in','key.number' , [$this->key]],"trim(coalesce(key.number, '')) <>'' " ],
|
||||
['and', ['in','key.rfid_key' ,[ $this->key ] ],"trim(coalesce(key.rfid_key, '')) <>'' "],
|
||||
|
||||
]);
|
||||
|
||||
$this->keyModel = $query->one();
|
||||
|
||||
if ( isset($this->keyModel) ){
|
||||
$assignments = CardKeyAssignment::find()->andWhere(['id_key' => $this->keyModel->id_key])->all();
|
||||
if ( count($assignments) > 0){
|
||||
|
||||
Reference in New Issue
Block a user