update card after activate
This commit is contained in:
@@ -6,6 +6,7 @@ namespace frontend\models;
|
||||
|
||||
use common\models\Card;
|
||||
use common\models\Ticket;
|
||||
use Exception;
|
||||
use Yii;
|
||||
use yii\base\Model;
|
||||
use yii\data\ArrayDataProvider;
|
||||
@@ -98,7 +99,7 @@ class SingleCustomerActivateForm extends Model{
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function activate()
|
||||
{
|
||||
@@ -106,7 +107,7 @@ class SingleCustomerActivateForm extends Model{
|
||||
return false;
|
||||
}
|
||||
|
||||
$tx = \Yii::$app->db->beginTransaction();
|
||||
$tx = Yii::$app->db->beginTransaction();
|
||||
assert(isset($tx));
|
||||
try {
|
||||
|
||||
@@ -122,8 +123,11 @@ class SingleCustomerActivateForm extends Model{
|
||||
]
|
||||
);
|
||||
Card::updateFlagStatus();
|
||||
|
||||
Card::updateCardFlagTicket( $this->card->id_card);
|
||||
|
||||
$tx->commit();
|
||||
} catch (\Exception $exception) {
|
||||
} catch (Exception $exception) {
|
||||
$tx->rollBack();
|
||||
throw $exception;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user