Open
Conversation
okazy
suggested changes
May 12, 2020
Contributor
okazy
left a comment
There was a problem hiding this comment.
@watarukashii
ありがとうございます。
確かに会員情報を記録しているので表示させた方が親切ですね。
動作確認しました。
ログインしていないユーザがレビューを投稿した場合に問題があるかと思います。
コードにコメントをしているので確認をお願いできますか?
| ->select('r, p, pc') | ||
| ->select('r, p, pc, c') | ||
| ->innerJoin('r.Product', 'p') | ||
| ->innerJoin('r.Customer', 'c') |
Contributor
There was a problem hiding this comment.
Suggested change
| ->innerJoin('r.Customer', 'c') | |
| ->leftJoin('r.Customer', 'c') |
ログインしないでレビューを投稿するとCustomerがnullになります。
�innerJoinでは会員が紐づいていないレビューが取得できなくなるかと思います。
| <td>{{ Review.reviewer_name }}</td> | ||
| <td> | ||
| {{ Review.reviewer_name }}<br> | ||
| <a href="{{ url('admin_customer_edit', { 'id': Review.Customer.id}) }}">{{ Review.Customer.name01 }} {{ Review.Customer.name02 }}</a><br> |
Contributor
There was a problem hiding this comment.
Suggested change
| <a href="{{ url('admin_customer_edit', { 'id': Review.Customer.id}) }}">{{ Review.Customer.name01 }} {{ Review.Customer.name02 }}</a><br> | |
| {% if Review.Customer %} | |
| <a href="{{ url('admin_customer_edit', { 'id': Review.Customer.id}) }}">{{ Review.Customer.name01 }} {{ Review.Customer.name02 }}</a> | |
| {% endif %} |
Customerが存在しないレビューでエラーとなるので条件分岐がいるかと思います。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
レビュー管理の一覧に会員情報を追加しました。リンク先をクリックすると会員詳細画面に遷移します。