diff --git a/app/AdminSupplier/Controllers/ProductController.php b/app/AdminSupplier/Controllers/ProductController.php index 1777ad5..9aae812 100644 --- a/app/AdminSupplier/Controllers/ProductController.php +++ b/app/AdminSupplier/Controllers/ProductController.php @@ -66,7 +66,12 @@ class ProductController extends AdminController protected function detail($id) { return Show::make($id, new Product(), function (Show $show) { - $show->field('id'); + //不允许查看非自己的数据 + if ($show->model()->supplier_id != Admin::user()->id) { + Admin::exit('数据不存在'); + } + + $show->field('id'); $show->field('supplier_id'); $show->field('category_id'); $show->field('title');