-
Notifications
You must be signed in to change notification settings - Fork 40
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
管理画面に会員情報の追加 #56
base: 4.0
Are you sure you want to change the base?
管理画面に会員情報の追加 #56
Conversation
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.
@watarukashii
ありがとうございます。
確かに会員情報を記録しているので表示させた方が親切ですね。
動作確認しました。
ログインしていないユーザがレビューを投稿した場合に問題があるかと思います。
コードにコメントをしているので確認をお願いできますか?
->innerJoin('r.Product', 'p') | ||
->innerJoin('r.Customer', 'c') |
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.
->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> |
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.
<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が存在しないレビューでエラーとなるので条件分岐がいるかと思います。
レビュー管理の一覧に会員情報を追加しました。リンク先をクリックすると会員詳細画面に遷移します。