Skip to content
This repository has been archived by the owner on Dec 12, 2020. It is now read-only.

Should set condition for count query in where functions (now condition is in the count function) #6

Closed
h3d-thanhpv opened this issue Nov 26, 2015 · 4 comments
Labels

Comments

@h3d-thanhpv
Copy link

This statement in file: ..\view\member\_header.php:
BbiiMessage::find()->inbox()->unread()->count('sendto = '.\Yii::$app->user->identity->id ); will have a bug when identity->id is not a number.
I think condition should place in where condition:
BbiiMessage::find()->where(['sendto' => Yii::$app->user->identity->id])->inbox()->unread()->count('sendto');

@h3d-thanhpv
Copy link
Author

It's has same problem in other file.

  • MessageController line 401, 402

@davidjeddy
Copy link
Contributor

Please submit PR with corrections.

@davidjeddy davidjeddy added the bug label Nov 26, 2015
@h3d-thanhpv
Copy link
Author

Hi, in file MessageController line 401, 402, it should be that:

'inbox' => BbiiMessage::find()->where(['sendto' => Yii::$app->user->identity->id])->inbox()->count('sendto'),

'outbox' => BbiiMessage::find()->where(['sendfrom' => Yii::$app->user->identity->id])->outbox()->count('sendfrom')

@davidjeddy
Copy link
Contributor

Submit PR, will pull it in and give you credit for the bug find.
https://help.github.com/articles/using-pull-requests/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants