diff --git a/app/AdminAgent/Controllers/SupplierController.php b/app/AdminAgent/Controllers/SupplierController.php new file mode 100644 index 0000000..c1a4e87 --- /dev/null +++ b/app/AdminAgent/Controllers/SupplierController.php @@ -0,0 +1,92 @@ +disableActions(); + $grid->disableCreateButton(); + $grid->disableRowSelector(); + $grid->disableFilterButton(); + + $grid->model()->where(function ($query) { + return $query->whereHas('AgentProductItem', function ($query) { + return $query->where('agent_id', Admin::user()->id); + }); + }); + + $grid->column('id')->sortable(); + $grid->column('name'); + $grid->column('company_name'); + $grid->column('address'); + $grid->column('director'); + $grid->column('contact_phone'); + $grid->column('logo')->image('', 60, 60); + $grid->column('avatar')->image('', 60, 60); + $grid->column('license_pic')->image('', 60, 60); + $grid->column('created_at', '入驻时间'); + + $grid->filter(function (Grid\Filter $filter) { + $filter->panel(); + + $filter->equal('id'); + }); + }); + } + + /** + * Make a show builder. + * + * @param mixed $id + * + * @return Show + */ + protected function detail($id) + { + return Show::make($id, new Supplier(), function (Show $show) { + $show->field('id'); + /*$show->field('name'); + $show->field('company_name'); + $show->field('address'); + $show->field('director'); + $show->field('contact_phone'); + $show->field('logo'); + $show->field('avatar'); + $show->field('license_pic'); + $show->field('created_at'); + $show->field('updated_at');*/ + }); + } + + /** + * Make a form builder. + * + * @return Form + */ + protected function form() + { + return Form::make(new Supplier(), function (Form $form) { + $form->display('id'); + })->saving(function (Form $form) { + $form->response()->error('操作禁止'); + })->deleting(function (Form $form) { + $form->response()->error('操作禁止'); + }); + } +} diff --git a/app/AdminAgent/Repositories/Supplier.php b/app/AdminAgent/Repositories/Supplier.php new file mode 100644 index 0000000..067a134 --- /dev/null +++ b/app/AdminAgent/Repositories/Supplier.php @@ -0,0 +1,16 @@ +resource('message/list', 'MessageController'); $router->resource('notice/list', 'NoticeController'); $router->resource('agent_info', 'AgentInfoController'); + $router->resource('supplier/list', 'SupplierController'); }); diff --git a/dcat_admin_ide_helper.php b/dcat_admin_ide_helper.php index 371bf3d..473a1fa 100644 --- a/dcat_admin_ide_helper.php +++ b/dcat_admin_ide_helper.php @@ -103,6 +103,7 @@ namespace Dcat\Admin { * @property Grid\Column|Collection money * @property Grid\Column|Collection order_id * @property Grid\Column|Collection transaction_id + * @property Grid\Column|Collection is_verify * @property Grid\Column|Collection nickname * @property Grid\Column|Collection openid * @property Grid\Column|Collection unionid @@ -199,6 +200,7 @@ namespace Dcat\Admin { * @method Grid\Column|Collection money(string $label = null) * @method Grid\Column|Collection order_id(string $label = null) * @method Grid\Column|Collection transaction_id(string $label = null) + * @method Grid\Column|Collection is_verify(string $label = null) * @method Grid\Column|Collection nickname(string $label = null) * @method Grid\Column|Collection openid(string $label = null) * @method Grid\Column|Collection unionid(string $label = null) @@ -300,6 +302,7 @@ namespace Dcat\Admin { * @property Show\Field|Collection money * @property Show\Field|Collection order_id * @property Show\Field|Collection transaction_id + * @property Show\Field|Collection is_verify * @property Show\Field|Collection nickname * @property Show\Field|Collection openid * @property Show\Field|Collection unionid @@ -396,6 +399,7 @@ namespace Dcat\Admin { * @method Show\Field|Collection money(string $label = null) * @method Show\Field|Collection order_id(string $label = null) * @method Show\Field|Collection transaction_id(string $label = null) + * @method Show\Field|Collection is_verify(string $label = null) * @method Show\Field|Collection nickname(string $label = null) * @method Show\Field|Collection openid(string $label = null) * @method Show\Field|Collection unionid(string $label = null)