Merge branch 'release/v0.1.25'
This commit is contained in:
commit
932e0e3595
@ -1,3 +1,5 @@
|
|||||||
|
-0.1.25
|
||||||
|
- fix update inactive card
|
||||||
-0.1.24
|
-0.1.24
|
||||||
- add activate/incativate card for coronavirus
|
- add activate/incativate card for coronavirus
|
||||||
-0.1.23
|
-0.1.23
|
||||||
|
|||||||
@ -5,7 +5,7 @@ return [
|
|||||||
'supportEmail' => 'rocho02@gmail.com',
|
'supportEmail' => 'rocho02@gmail.com',
|
||||||
'infoEmail' => 'info@rocho-net.hu',
|
'infoEmail' => 'info@rocho-net.hu',
|
||||||
'user.passwordResetTokenExpire' => 3600,
|
'user.passwordResetTokenExpire' => 3600,
|
||||||
'version' => 'v0.1.24',
|
'version' => 'v0.1.25',
|
||||||
'company' => 'movar',//gyor
|
'company' => 'movar',//gyor
|
||||||
'company_name' => "Freimann Kft.",
|
'company_name' => "Freimann Kft.",
|
||||||
'product_visiblity' => 'account',// on reception which products to display. account or global
|
'product_visiblity' => 'account',// on reception which products to display. account or global
|
||||||
|
|||||||
@ -90,7 +90,18 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
|
|||||||
where
|
where
|
||||||
c.status = 20
|
c.status = 20
|
||||||
and c.inactivated_at is not null
|
and c.inactivated_at is not null
|
||||||
and ((t.start <= c.inactivated_at and t.end >= c.inactivated_at) or (t.start >= c.inactivated_at)) ;";
|
and ((t.start <= c.inactivated_at and t.end >= c.inactivated_at) ) ";
|
||||||
|
|
||||||
|
public static $SQL_UPDATE_TICKETS_END_DATE_ON_CARD_ACTIVATION_SINGLE_CARD = "UPDATE ticket t
|
||||||
|
inner join card c on t.id_card = c.id_card
|
||||||
|
SET end = date_add( end, INTERVAL datediff(current_date, c.inactivated_at) DAY )
|
||||||
|
where
|
||||||
|
c.status = 20
|
||||||
|
and c.inactivated_at is not null
|
||||||
|
and ((t.start <= c.inactivated_at and t.end >= c.inactivated_at) ) and c.id_card = :id_card ";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static function SQL_UPDATE_DOOR_ALLOWED_FLAG(){
|
public static function SQL_UPDATE_DOOR_ALLOWED_FLAG(){
|
||||||
return "
|
return "
|
||||||
|
|||||||
@ -11,6 +11,8 @@ use Yii;
|
|||||||
use yii\base\Model;
|
use yii\base\Model;
|
||||||
use yii\data\ArrayDataProvider;
|
use yii\data\ArrayDataProvider;
|
||||||
use yii\db\Query;
|
use yii\db\Query;
|
||||||
|
use yii\web\HttpException;
|
||||||
|
use yii\web\ServerErrorHttpException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class SingleCustomerActivateForm
|
* Class SingleCustomerActivateForm
|
||||||
@ -68,13 +70,10 @@ class SingleCustomerActivateForm extends Model{
|
|||||||
->innerJoin(Card::tableName(), 'card.id_card = ticket.id_card')
|
->innerJoin(Card::tableName(), 'card.id_card = ticket.id_card')
|
||||||
->andWhere(['ticket.id_card' => $this->card->id_card])
|
->andWhere(['ticket.id_card' => $this->card->id_card])
|
||||||
->andWhere(
|
->andWhere(
|
||||||
['or',
|
|
||||||
['and',
|
['and',
|
||||||
['<=','ticket.start',$this->card->inactivated_at ],
|
['<=','ticket.start',$this->card->inactivated_at ],
|
||||||
['>=','ticket.end',$this->card->inactivated_at ]
|
['>=','ticket.end',$this->card->inactivated_at ]
|
||||||
],
|
]
|
||||||
['>=','ticket.start',$this->card->inactivated_at ],
|
|
||||||
]
|
|
||||||
)
|
)
|
||||||
->orderBy(
|
->orderBy(
|
||||||
[
|
[
|
||||||
@ -107,12 +106,19 @@ class SingleCustomerActivateForm extends Model{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ( !isset($this->card) || !isset($this->card->id_card) || empty($this->card->id_card)){
|
||||||
|
throw new ServerErrorHttpException("Hiba történt: nics kártya megadva");
|
||||||
|
}
|
||||||
|
|
||||||
$tx = Yii::$app->db->beginTransaction();
|
$tx = Yii::$app->db->beginTransaction();
|
||||||
assert(isset($tx));
|
assert(isset($tx));
|
||||||
try {
|
try {
|
||||||
|
|
||||||
Yii::$app->db->createCommand(Ticket::$SQL_UPDATE_TICKETS_END_DATE_ON_CARD_ACTIVATION
|
$command = Yii::$app->db->createCommand(Ticket::$SQL_UPDATE_TICKETS_END_DATE_ON_CARD_ACTIVATION_SINGLE_CARD,[':id_card' => $this->card->id_card]);
|
||||||
. " AND id_card = '" . $this->card->id_card . "'")->execute();
|
|
||||||
|
$command->execute();
|
||||||
|
|
||||||
Card::updateAll(
|
Card::updateAll(
|
||||||
[
|
[
|
||||||
'status' => Card::STATUS_ACTIVE,
|
'status' => Card::STATUS_ACTIVE,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user