fix togglekey asci chars

This commit is contained in:
Roland Schneider 2016-02-29 07:40:36 +01:00
parent 35accca381
commit 3926498f3e

View File

@ -7,6 +7,7 @@ use yii\base\Model;
use common\models\CardKeyAssignment; use common\models\CardKeyAssignment;
use common\models\Key; use common\models\Key;
use yii\helpers\ArrayHelper; use yii\helpers\ArrayHelper;
use common\components\Helper;
/** /**
* ContactForm is the model behind the contact form. * ContactForm is the model behind the contact form.
@ -43,6 +44,8 @@ class KeyToggleForm extends Model
public function toggleKey(){ public function toggleKey(){
$query= Key::find(); $query= Key::find();
$this->key = Helper::fixAsciiChars($this->key);
$query->andWhere(['or', $query->andWhere(['or',
['and',[ 'in','key.number' , [$this->key]],"trim(coalesce(key.number, '')) <>'' " ], ['and',[ 'in','key.number' , [$this->key]],"trim(coalesce(key.number, '')) <>'' " ],
['and', ['in','key.rfid_key' ,[ $this->key ] ],"trim(coalesce(key.rfid_key, '')) <>'' "], ['and', ['in','key.rfid_key' ,[ $this->key ] ],"trim(coalesce(key.rfid_key, '')) <>'' "],