Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

micro fixes #1332

Merged
merged 1 commit into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/modules/frontend/controllers/PlayerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function actionIndex()
public function actionClearVerificationToken($id)
{
$model = $this->findModel($id);
$model->updateAttributes(['verification_token' => null]);
\app\modules\frontend\models\PlayerToken::deleteAll(['player_id' => $model->id, 'type' => 'email_verification']);
return $this->goBack((!empty(Yii::$app->request->referrer) ? Yii::$app->request->referrer : null));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function behaviors()
parent::behaviors(),
[
'verbs' => [
'class' => VerbFilter::className(),
'class' => VerbFilter::class,
'actions' => [
'delete' => ['POST'],
],
Expand Down
5 changes: 4 additions & 1 deletion frontend/widgets/target/HeadshotsWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ public function init()
public function run()
{
$headshots = [];
$sql = "SELECT player.id,player.username,profile.id as profile_id,profile.visibility FROM headshot LEFT JOIN player ON player.id=headshot.player_id LEFT JOIN profile on profile.player_id=player.id WHERE headshot.target_id=:target_id AND player.status=10 ORDER BY headshot.created_at DESC,headshot.player_id asc LIMIT 50";
$academicStr="";
if(\Yii::$app->sys->academic_grouping!==false)
$academicStr=" AND player.academic=".\Yii::$app->user->identity->academic;
$sql = "SELECT player.id,player.username,profile.id as profile_id,profile.visibility FROM headshot LEFT JOIN player ON player.id=headshot.player_id LEFT JOIN profile on profile.player_id=player.id WHERE headshot.target_id=:target_id AND player.status=10 {$academicStr} ORDER BY headshot.created_at DESC,headshot.player_id asc LIMIT 50";
$result = \Yii::$app->db->createCommand($sql, [':target_id' => $this->target_id])->cache(180)->query();

foreach ($result as $hs) {
Expand Down