Finish version/v.0.083

This commit is contained in:
Roland Schneider 2016-07-31 13:08:48 +02:00
commit 23dba0841a
3 changed files with 19 additions and 4 deletions

View File

@ -1,3 +1,5 @@
-0.0.83
- add rfid ascii char fix to key save/update
-0.0.82
- add rfid check to card package import
-0.0.81

View File

@ -5,7 +5,7 @@ return [
'supportEmail' => 'rocho02@gmail.com',
'infoEmail' => 'info@rocho-net.hu',
'user.passwordResetTokenExpire' => 3600,
'version' => 'v0.0.82',
'version' => 'v0.0.83',
'company' => 'movar',//gyor
'company_name' => "Freimann Kft.",
'product_visiblity' => 'account',// on reception which products to display. account or global

View File

@ -12,6 +12,7 @@ use common\components\Helper;
*
* @property integer $id_key
* @property string $number
* @property string $rfid_key
* @property integer $status
* @property integer $type
* @property string $created_at
@ -97,18 +98,30 @@ class Key extends \yii\db\ActiveRecord
/**
* @param yii\db\Query $query
* @param \yii\db\Query $query
* */
public static function addKeyCondition($query, $number , $fieldNumber = "key.number",$fieldRfid = "key.rfid_key"){
$number = Helper::fixAsciiChars($number);
$query->andWhere( ['or' , [$fieldNumber =>$number ],[$fieldRfid =>$number ] ]);
}
/**
* @param yii\db\Query $query
* @param \yii\db\Query $query
* */
public static function addKeyConditionOptional($query, $number , $fieldNumber = "key.number",$fieldRfid = "key.rfid_key"){
$number = Helper::fixAsciiChars($number);
$query->andFilterWhere( ['or' , [$fieldNumber =>$number ],[$fieldRfid =>$number ] ]);
}
public function beforeSave($insert)
{
if ( parent::beforeSave($insert) ){
$this->rfid_key = Helper::fixAsciiChars($this->rfid_key);
return true;
}
return false;
}
}