|
|
|
@ -23,6 +23,7 @@ class IndustryProductController extends AdminController |
|
|
|
{ |
|
|
|
return Grid::make(new IndustryProduct(['category']), function (Grid $grid) { |
|
|
|
$grid->disableCreateButton(); |
|
|
|
$grid->disableDeleteButton(); |
|
|
|
|
|
|
|
//如果是审核页面,多加where条件判断
|
|
|
|
if (strpos(Route::current()->uri, 'audit')) { |
|
|
|
@ -74,6 +75,8 @@ class IndustryProductController extends AdminController |
|
|
|
protected function detail($id) |
|
|
|
{ |
|
|
|
return Show::make($id, new IndustryProduct(['category:id,name', 'supplier:id,name,contact_phone']), function (Show $show) { |
|
|
|
$show->disableDeleteButton(); |
|
|
|
|
|
|
|
$show->field('id'); |
|
|
|
$show->field('supplier.name', '供应商'); |
|
|
|
$show->field('supplier.contact_phone', '供应商联系电话'); |
|
|
|
@ -104,6 +107,8 @@ class IndustryProductController extends AdminController |
|
|
|
protected function form() |
|
|
|
{ |
|
|
|
return Form::make(new IndustryProduct(['supplier:id,name', 'category:id,name']), function (Form $form) { |
|
|
|
$form->disableDeleteButton(); |
|
|
|
|
|
|
|
$form->display('id'); |
|
|
|
$form->select('status')->options(ProductStatus::array()); |
|
|
|
})->saving(function (Form $form) { |
|
|
|
@ -114,7 +119,7 @@ class IndustryProductController extends AdminController |
|
|
|
return $form->response()->error('操作禁止!')->refresh(); |
|
|
|
} |
|
|
|
})->deleting(function (Form $form) { |
|
|
|
|
|
|
|
return $form->response()->error('操作禁止!')->refresh(); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |