diff --git a/frontend/controllers/CabinetController.php b/frontend/controllers/CabinetController.php index d1a633d..60fbf45 100755 --- a/frontend/controllers/CabinetController.php +++ b/frontend/controllers/CabinetController.php @@ -148,7 +148,10 @@ public function actionNotifications() { - return $this->render('notifications'); + $table = Report::find()->all(); + return $this->render('notifications', [ + 'table' => $table, + ]); } public function actionUsers() diff --git a/frontend/models/Report.php b/frontend/models/Report.php index f0eb92e..3257a65 100755 --- a/frontend/models/Report.php +++ b/frontend/models/Report.php @@ -118,7 +118,14 @@ 'play_count', ] ); + } parent::afterSave($insert, $changedAttributes); } + + public function beforeSave($insert) + { + $this->royalty = $this->sum * 0.8 * 0.805; + return parent::beforeSave($insert); + } } diff --git a/frontend/views/cabinet/notifications.php b/frontend/views/cabinet/notifications.php index 172d9b1..30876fe 100755 --- a/frontend/views/cabinet/notifications.php +++ b/frontend/views/cabinet/notifications.php @@ -1,8 +1,10 @@