Skip to content

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

Open
watarukashii wants to merge 3 commits intoEC-CUBE:4.0from
watarukashii:4.0
Open

管理画面に会員情報の追加#56
watarukashii wants to merge 3 commits intoEC-CUBE:4.0from
watarukashii:4.0

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
ありがとうございます。
確かに会員情報を記録しているので表示させた方が親切ですね。

動作確認しました。
ログインしていないユーザがレビューを投稿した場合に問題があるかと思います。
コードにコメントをしているので確認をお願いできますか?

->select('r, p, pc')
->select('r, p, pc, c')
->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