Browse Source

不允许查看非自己数据

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

7
app/AdminSupplier/Controllers/ProductController.php

@ -66,7 +66,12 @@ class ProductController extends AdminController
protected function detail($id) protected function detail($id)
{ {
return Show::make($id, new Product(), function (Show $show) { 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('supplier_id');
$show->field('category_id'); $show->field('category_id');
$show->field('title'); $show->field('title');

Loading…
Cancel
Save