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

管理画面に会員情報の追加 #56

Open
wants to merge 3 commits into
base: 4.0
Choose a base branch
from

Conversation

watarukashii
Copy link

レビュー管理の一覧に会員情報を追加しました。リンク先をクリックすると会員詳細画面に遷移します。

Copy link
Contributor

@okazy okazy left a 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')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 }}&nbsp;{{ Review.Customer.name02 }}</a><br>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<a href="{{ url('admin_customer_edit', { 'id': Review.Customer.id}) }}">{{ Review.Customer.name01 }}&nbsp;{{ Review.Customer.name02 }}</a><br>
{% if Review.Customer %}
<a href="{{ url('admin_customer_edit', { 'id': Review.Customer.id}) }}">{{ Review.Customer.name01 }}&nbsp;{{ Review.Customer.name02 }}</a>
{% endif %}

Customerが存在しないレビューでエラーとなるので条件分岐がいるかと思います。

@okazy okazy added this to the 4.0.2 milestone May 12, 2020
@chihiro-adachi chihiro-adachi modified the milestones: 4.0.2, 4.0.x Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants