Browse Source

不允许查看非自己数据

master
李可松 4 years ago
parent
commit
51af4de335
  1. 5
      app/AdminSupplier/Controllers/ProductController.php

5
app/AdminSupplier/Controllers/ProductController.php

@ -66,6 +66,11 @@ class ProductController extends AdminController
protected function detail($id)
{
return Show::make($id, new Product(), function (Show $show) {
//不允许查看非自己的数据
if ($show->model()->supplier_id != Admin::user()->id) {
Admin::exit('数据不存在');
}
$show->field('id');
$show->field('supplier_id');
$show->field('category_id');

Loading…
Cancel
Save