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
タグ一覧画面を追加 #288
タグ一覧画面を追加 #288
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #288 +/- ##
=============================================
- Coverage 35.84% 35.31% -0.54%
- Complexity 296 300 +4
=============================================
Files 60 61 +1
Lines 1127 1144 +17
=============================================
Hits 404 404
- Misses 723 740 +17
Continue to review full report at Codecov.
|
🙇♂️ 要変更点
🤔 検討
💬 課題についてボタンの色私はこれでいいと思います。 タグボタンをcomponentsに切り出した方がいい?本画面と関連タグ検索画面くらいでしか使わなそうな気はしますね……。 タグを探すための機能という点で類似しているので、見た目を一貫させるべきかの議論をしたほうが良いのかも? タグ画面はログイン必須にする?検索画面がゲスト許可なの忘れてた。でも検索機能に準拠するのが妥当だろうと思いますので、現状のゲスト許可でOKです。 |
)) | ||
->join('ejaculation_tag', 'tags.id', '=', 'ejaculation_tag.tag_id') | ||
->join('ejaculations', 'ejaculations.id', '=', 'ejaculation_tag.ejaculation_id') | ||
->where('ejaculations.is_private', false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
グループ化+カウントの部分は
$tags = Tag::select(['tags.name'])
->withCount(['ejaculations as checkins_count' => function ($query) {
$query->where('is_private', false);
}])
にしたほうがコードはスッキリしそうです。実行SQLはきしょいですけど
ref: https://readouble.com/laravel/5.5/ja/eloquent-relationships.html#counting-related-models
先ほど気づきましたが、タグ一覧の取得処理はチェックイン実行ユーザーが鍵垢である場合を考慮する必要がありそうですね。。 |
タグ一覧のチェックイン件数カウント条件を検索機能の表示条件と揃える対応を実施しました。 (withCountの件については、joinせずにチェックイン0件のタグを一覧から除外する方法が思いつかなかったので一旦保留) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
要変更点および検討事項について、対応を確認しました。
withCountは確かに……数日以内に思いついたら書きます、思いつかなかったらとりあえずマージしようかな。
思いつかないからマージします。 |
どのようなタグが使われているかを一覧化し、気になるタグからオカズへ到達しやすくするため、タグ一覧画面を作成しました。
仕様
課題