issue #5820 fixed
This commit is contained in:
parent
23666466f4
commit
384c1a7198
|
|
@ -155,20 +155,26 @@ class ReviewController extends Controller
|
|||
$review = $this->productReviewRepository->findOneByField('id', $value);
|
||||
|
||||
try {
|
||||
if ($data['massaction-type'] == 'update') {
|
||||
if ($data['update-options'] == 1) {
|
||||
Event::dispatch('customer.review.update.before', $value);
|
||||
if (! isset($data['massaction-type'])) {
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
$review->update(['status' => 'approved']);
|
||||
if (! $data['massaction-type'] == 'update') {
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
Event::dispatch('customer.review.update.after', $review);
|
||||
} elseif ($data['update-options'] == 0) {
|
||||
$review->update(['status' => 'pending']);
|
||||
} elseif ($data['update-options'] == 2) {
|
||||
$review->update(['status' => 'disapproved']);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
if ($data['update-options'] == 1) {
|
||||
Event::dispatch('customer.review.update.before', $value);
|
||||
|
||||
$review->update(['status' => 'approved']);
|
||||
|
||||
Event::dispatch('customer.review.update.after', $review);
|
||||
} elseif ($data['update-options'] == 0) {
|
||||
$review->update(['status' => 'pending']);
|
||||
} elseif ($data['update-options'] == 2) {
|
||||
$review->update(['status' => 'disapproved']);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$suppressFlash = true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue