reports
This commit is contained in:
32
frontend/modules/reports/models/Reports.php
Normal file
32
frontend/modules/reports/models/Reports.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace frontend\modules\reports\models;
|
||||
|
||||
use common\classes\Debug;
|
||||
use common\models\UserCard;
|
||||
use Yii;
|
||||
|
||||
class Reports extends \common\models\Reports
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
}
|
||||
|
||||
// public function beforeSave($insert)
|
||||
// {
|
||||
// $user_card = UserCard::findOne(['id_user' => Yii::$app->user->identity->id]);
|
||||
// $this->user_card_id = $user_card->id;
|
||||
// return parent::beforeSave($insert);
|
||||
// }
|
||||
|
||||
public function beforeValidate()
|
||||
{
|
||||
if (empty($this->user_card_id)) {
|
||||
$user_card = UserCard::findOne(['id_user' => Yii::$app->user->identity->id]);
|
||||
$this->user_card_id = $user_card->id;
|
||||
}
|
||||
return parent::beforeValidate();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user