From cc179cd6016cb0c69af31ba8cd7e6bbbcea80e3f Mon Sep 17 00:00:00 2001 From: Mike Date: Thu, 6 Aug 2020 13:54:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9C=8D=E5=8A=A1=E5=95=86?= =?UTF-8?q?=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ImsCjdcMarketController.php | 22 +++ dcat_admin_ide_helper.php | 152 +++++++++--------- 2 files changed, 102 insertions(+), 72 deletions(-) diff --git a/app/Admin/Controllers/ImsCjdcMarketController.php b/app/Admin/Controllers/ImsCjdcMarketController.php index 20510aa..31a5b15 100644 --- a/app/Admin/Controllers/ImsCjdcMarketController.php +++ b/app/Admin/Controllers/ImsCjdcMarketController.php @@ -41,8 +41,18 @@ class ImsCjdcMarketController extends AdminController $grid->column('addtime','创建时间'); $grid->filter(function (Grid\Filter $filter) { $filter->equal('id'); + }); + + + $grid->actions(function (Grid\Displayers\Actions $actions){ + + if(!\Admin::user()->isAdministrator()&&$actions->row->mp_id==0){ + $actions->disableDelete(); + $actions->disableEdit(); + } }); + }); } @@ -56,6 +66,18 @@ class ImsCjdcMarketController extends AdminController protected function detail($id) { return Show::make($id, new ImsCjdcMarket(), function (Show $show) { + + if(!\Admin::user()->isAdministrator()&&$show->model()->mp_id==0){ + $show->panel() + ->tools(function ($tools) { + $tools->disableEdit(); + $tools->disableList(); + $tools->disableDelete(); + // 显示快捷编辑按钮 + $tools->showQuickEdit(); + }); + } + $show->id; $show->name; $show->logo->image(); diff --git a/dcat_admin_ide_helper.php b/dcat_admin_ide_helper.php index d9aa1ad..4c2146f 100644 --- a/dcat_admin_ide_helper.php +++ b/dcat_admin_ide_helper.php @@ -44,7 +44,25 @@ namespace Dcat\Admin { * @property Grid\Column|Collection id_number * @property Grid\Column|Collection admin_user_id * @property Grid\Column|Collection status + * @property Grid\Column|Collection market_id * @property Grid\Column|Collection is_del + * @property Grid\Column|Collection logo + * @property Grid\Column|Collection address + * @property Grid\Column|Collection introduce + * @property Grid\Column|Collection imgs + * @property Grid\Column|Collection addtime + * @property Grid\Column|Collection sort + * @property Grid\Column|Collection coordinates + * @property Grid\Column|Collection remark + * @property Grid\Column|Collection poundage + * @property Grid\Column|Collection dn_poundage + * @property Grid\Column|Collection dm_poundage + * @property Grid\Column|Collection yd_poundage + * @property Grid\Column|Collection dada_number + * @property Grid\Column|Collection is_open_dada + * @property Grid\Column|Collection loudspeaker_imei + * @property Grid\Column|Collection dishes_menu_intro + * @property Grid\Column|Collection create_time * @property Grid\Column|Collection parent_id * @property Grid\Column|Collection order * @property Grid\Column|Collection icon @@ -68,7 +86,6 @@ namespace Dcat\Admin { * @property Grid\Column|Collection createtime * @property Grid\Column|Collection updatetime * @property Grid\Column|Collection token - * @property Grid\Column|Collection market_id * @property Grid\Column|Collection admin_id * @property Grid\Column|Collection url * @property Grid\Column|Collection content @@ -98,7 +115,6 @@ namespace Dcat\Admin { * @property Grid\Column|Collection group_id * @property Grid\Column|Collection type * @property Grid\Column|Collection condition - * @property Grid\Column|Collection remark * @property Grid\Column|Collection ismenu * @property Grid\Column|Collection weigh * @property Grid\Column|Collection flag @@ -207,7 +223,6 @@ namespace Dcat\Admin { * @property Grid\Column|Collection weid * @property Grid\Column|Collection qq * @property Grid\Column|Collection dist - * @property Grid\Column|Collection address * @property Grid\Column|Collection industry1 * @property Grid\Column|Collection industry2 * @property Grid\Column|Collection from_user @@ -225,7 +240,6 @@ namespace Dcat\Admin { * @property Grid\Column|Collection is_notice_service * @property Grid\Column|Collection is_notice_boss * @property Grid\Column|Collection authority - * @property Grid\Column|Collection logo * @property Grid\Column|Collection src * @property Grid\Column|Collection src2 * @property Grid\Column|Collection created_time @@ -279,12 +293,10 @@ namespace Dcat\Admin { * @property Grid\Column|Collection fe_dycode * @property Grid\Column|Collection xx_sn * @property Grid\Column|Collection tag_name - * @property Grid\Column|Collection sort * @property Grid\Column|Collection son_id * @property Grid\Column|Collection note * @property Grid\Column|Collection sn * @property Grid\Column|Collection simnum - * @property Grid\Column|Collection addtime * @property Grid\Column|Collection fx_details * @property Grid\Column|Collection tx_details * @property Grid\Column|Collection is_fx @@ -374,18 +386,8 @@ namespace Dcat\Admin { * @property Grid\Column|Collection waimai_pay_temp * @property Grid\Column|Collection dangmian_pay_temp * @property Grid\Column|Collection ziti_pay_temp - * @property Grid\Column|Collection introduce - * @property Grid\Column|Collection imgs - * @property Grid\Column|Collection coordinates - * @property Grid\Column|Collection poundage - * @property Grid\Column|Collection dn_poundage - * @property Grid\Column|Collection dm_poundage - * @property Grid\Column|Collection yd_poundage - * @property Grid\Column|Collection dada_number - * @property Grid\Column|Collection is_open_dada - * @property Grid\Column|Collection loudspeaker_imei - * @property Grid\Column|Collection dishes_menu_intro - * @property Grid\Column|Collection create_time + * @property Grid\Column|Collection mp_id + * @property Grid\Column|Collection deleted_at * @property Grid\Column|Collection sender * @property Grid\Column|Collection is_email * @property Grid\Column|Collection xd_tid @@ -1195,7 +1197,25 @@ namespace Dcat\Admin { * @method Grid\Column|Collection id_number(string $label = null) * @method Grid\Column|Collection admin_user_id(string $label = null) * @method Grid\Column|Collection status(string $label = null) + * @method Grid\Column|Collection market_id(string $label = null) * @method Grid\Column|Collection is_del(string $label = null) + * @method Grid\Column|Collection logo(string $label = null) + * @method Grid\Column|Collection address(string $label = null) + * @method Grid\Column|Collection introduce(string $label = null) + * @method Grid\Column|Collection imgs(string $label = null) + * @method Grid\Column|Collection addtime(string $label = null) + * @method Grid\Column|Collection sort(string $label = null) + * @method Grid\Column|Collection coordinates(string $label = null) + * @method Grid\Column|Collection remark(string $label = null) + * @method Grid\Column|Collection poundage(string $label = null) + * @method Grid\Column|Collection dn_poundage(string $label = null) + * @method Grid\Column|Collection dm_poundage(string $label = null) + * @method Grid\Column|Collection yd_poundage(string $label = null) + * @method Grid\Column|Collection dada_number(string $label = null) + * @method Grid\Column|Collection is_open_dada(string $label = null) + * @method Grid\Column|Collection loudspeaker_imei(string $label = null) + * @method Grid\Column|Collection dishes_menu_intro(string $label = null) + * @method Grid\Column|Collection create_time(string $label = null) * @method Grid\Column|Collection parent_id(string $label = null) * @method Grid\Column|Collection order(string $label = null) * @method Grid\Column|Collection icon(string $label = null) @@ -1219,7 +1239,6 @@ namespace Dcat\Admin { * @method Grid\Column|Collection createtime(string $label = null) * @method Grid\Column|Collection updatetime(string $label = null) * @method Grid\Column|Collection token(string $label = null) - * @method Grid\Column|Collection market_id(string $label = null) * @method Grid\Column|Collection admin_id(string $label = null) * @method Grid\Column|Collection url(string $label = null) * @method Grid\Column|Collection content(string $label = null) @@ -1249,7 +1268,6 @@ namespace Dcat\Admin { * @method Grid\Column|Collection group_id(string $label = null) * @method Grid\Column|Collection type(string $label = null) * @method Grid\Column|Collection condition(string $label = null) - * @method Grid\Column|Collection remark(string $label = null) * @method Grid\Column|Collection ismenu(string $label = null) * @method Grid\Column|Collection weigh(string $label = null) * @method Grid\Column|Collection flag(string $label = null) @@ -1358,7 +1376,6 @@ namespace Dcat\Admin { * @method Grid\Column|Collection weid(string $label = null) * @method Grid\Column|Collection qq(string $label = null) * @method Grid\Column|Collection dist(string $label = null) - * @method Grid\Column|Collection address(string $label = null) * @method Grid\Column|Collection industry1(string $label = null) * @method Grid\Column|Collection industry2(string $label = null) * @method Grid\Column|Collection from_user(string $label = null) @@ -1376,7 +1393,6 @@ namespace Dcat\Admin { * @method Grid\Column|Collection is_notice_service(string $label = null) * @method Grid\Column|Collection is_notice_boss(string $label = null) * @method Grid\Column|Collection authority(string $label = null) - * @method Grid\Column|Collection logo(string $label = null) * @method Grid\Column|Collection src(string $label = null) * @method Grid\Column|Collection src2(string $label = null) * @method Grid\Column|Collection created_time(string $label = null) @@ -1430,12 +1446,10 @@ namespace Dcat\Admin { * @method Grid\Column|Collection fe_dycode(string $label = null) * @method Grid\Column|Collection xx_sn(string $label = null) * @method Grid\Column|Collection tag_name(string $label = null) - * @method Grid\Column|Collection sort(string $label = null) * @method Grid\Column|Collection son_id(string $label = null) * @method Grid\Column|Collection note(string $label = null) * @method Grid\Column|Collection sn(string $label = null) * @method Grid\Column|Collection simnum(string $label = null) - * @method Grid\Column|Collection addtime(string $label = null) * @method Grid\Column|Collection fx_details(string $label = null) * @method Grid\Column|Collection tx_details(string $label = null) * @method Grid\Column|Collection is_fx(string $label = null) @@ -1525,18 +1539,8 @@ namespace Dcat\Admin { * @method Grid\Column|Collection waimai_pay_temp(string $label = null) * @method Grid\Column|Collection dangmian_pay_temp(string $label = null) * @method Grid\Column|Collection ziti_pay_temp(string $label = null) - * @method Grid\Column|Collection introduce(string $label = null) - * @method Grid\Column|Collection imgs(string $label = null) - * @method Grid\Column|Collection coordinates(string $label = null) - * @method Grid\Column|Collection poundage(string $label = null) - * @method Grid\Column|Collection dn_poundage(string $label = null) - * @method Grid\Column|Collection dm_poundage(string $label = null) - * @method Grid\Column|Collection yd_poundage(string $label = null) - * @method Grid\Column|Collection dada_number(string $label = null) - * @method Grid\Column|Collection is_open_dada(string $label = null) - * @method Grid\Column|Collection loudspeaker_imei(string $label = null) - * @method Grid\Column|Collection dishes_menu_intro(string $label = null) - * @method Grid\Column|Collection create_time(string $label = null) + * @method Grid\Column|Collection mp_id(string $label = null) + * @method Grid\Column|Collection deleted_at(string $label = null) * @method Grid\Column|Collection sender(string $label = null) * @method Grid\Column|Collection is_email(string $label = null) * @method Grid\Column|Collection xd_tid(string $label = null) @@ -2351,7 +2355,25 @@ namespace Dcat\Admin { * @property Show\Field|Collection id_number * @property Show\Field|Collection admin_user_id * @property Show\Field|Collection status + * @property Show\Field|Collection market_id * @property Show\Field|Collection is_del + * @property Show\Field|Collection logo + * @property Show\Field|Collection address + * @property Show\Field|Collection introduce + * @property Show\Field|Collection imgs + * @property Show\Field|Collection addtime + * @property Show\Field|Collection sort + * @property Show\Field|Collection coordinates + * @property Show\Field|Collection remark + * @property Show\Field|Collection poundage + * @property Show\Field|Collection dn_poundage + * @property Show\Field|Collection dm_poundage + * @property Show\Field|Collection yd_poundage + * @property Show\Field|Collection dada_number + * @property Show\Field|Collection is_open_dada + * @property Show\Field|Collection loudspeaker_imei + * @property Show\Field|Collection dishes_menu_intro + * @property Show\Field|Collection create_time * @property Show\Field|Collection parent_id * @property Show\Field|Collection order * @property Show\Field|Collection icon @@ -2375,7 +2397,6 @@ namespace Dcat\Admin { * @property Show\Field|Collection createtime * @property Show\Field|Collection updatetime * @property Show\Field|Collection token - * @property Show\Field|Collection market_id * @property Show\Field|Collection admin_id * @property Show\Field|Collection url * @property Show\Field|Collection content @@ -2405,7 +2426,6 @@ namespace Dcat\Admin { * @property Show\Field|Collection group_id * @property Show\Field|Collection type * @property Show\Field|Collection condition - * @property Show\Field|Collection remark * @property Show\Field|Collection ismenu * @property Show\Field|Collection weigh * @property Show\Field|Collection flag @@ -2514,7 +2534,6 @@ namespace Dcat\Admin { * @property Show\Field|Collection weid * @property Show\Field|Collection qq * @property Show\Field|Collection dist - * @property Show\Field|Collection address * @property Show\Field|Collection industry1 * @property Show\Field|Collection industry2 * @property Show\Field|Collection from_user @@ -2532,7 +2551,6 @@ namespace Dcat\Admin { * @property Show\Field|Collection is_notice_service * @property Show\Field|Collection is_notice_boss * @property Show\Field|Collection authority - * @property Show\Field|Collection logo * @property Show\Field|Collection src * @property Show\Field|Collection src2 * @property Show\Field|Collection created_time @@ -2586,12 +2604,10 @@ namespace Dcat\Admin { * @property Show\Field|Collection fe_dycode * @property Show\Field|Collection xx_sn * @property Show\Field|Collection tag_name - * @property Show\Field|Collection sort * @property Show\Field|Collection son_id * @property Show\Field|Collection note * @property Show\Field|Collection sn * @property Show\Field|Collection simnum - * @property Show\Field|Collection addtime * @property Show\Field|Collection fx_details * @property Show\Field|Collection tx_details * @property Show\Field|Collection is_fx @@ -2681,18 +2697,8 @@ namespace Dcat\Admin { * @property Show\Field|Collection waimai_pay_temp * @property Show\Field|Collection dangmian_pay_temp * @property Show\Field|Collection ziti_pay_temp - * @property Show\Field|Collection introduce - * @property Show\Field|Collection imgs - * @property Show\Field|Collection coordinates - * @property Show\Field|Collection poundage - * @property Show\Field|Collection dn_poundage - * @property Show\Field|Collection dm_poundage - * @property Show\Field|Collection yd_poundage - * @property Show\Field|Collection dada_number - * @property Show\Field|Collection is_open_dada - * @property Show\Field|Collection loudspeaker_imei - * @property Show\Field|Collection dishes_menu_intro - * @property Show\Field|Collection create_time + * @property Show\Field|Collection mp_id + * @property Show\Field|Collection deleted_at * @property Show\Field|Collection sender * @property Show\Field|Collection is_email * @property Show\Field|Collection xd_tid @@ -3502,7 +3508,25 @@ namespace Dcat\Admin { * @method Show\Field|Collection id_number(string $label = null) * @method Show\Field|Collection admin_user_id(string $label = null) * @method Show\Field|Collection status(string $label = null) + * @method Show\Field|Collection market_id(string $label = null) * @method Show\Field|Collection is_del(string $label = null) + * @method Show\Field|Collection logo(string $label = null) + * @method Show\Field|Collection address(string $label = null) + * @method Show\Field|Collection introduce(string $label = null) + * @method Show\Field|Collection imgs(string $label = null) + * @method Show\Field|Collection addtime(string $label = null) + * @method Show\Field|Collection sort(string $label = null) + * @method Show\Field|Collection coordinates(string $label = null) + * @method Show\Field|Collection remark(string $label = null) + * @method Show\Field|Collection poundage(string $label = null) + * @method Show\Field|Collection dn_poundage(string $label = null) + * @method Show\Field|Collection dm_poundage(string $label = null) + * @method Show\Field|Collection yd_poundage(string $label = null) + * @method Show\Field|Collection dada_number(string $label = null) + * @method Show\Field|Collection is_open_dada(string $label = null) + * @method Show\Field|Collection loudspeaker_imei(string $label = null) + * @method Show\Field|Collection dishes_menu_intro(string $label = null) + * @method Show\Field|Collection create_time(string $label = null) * @method Show\Field|Collection parent_id(string $label = null) * @method Show\Field|Collection order(string $label = null) * @method Show\Field|Collection icon(string $label = null) @@ -3526,7 +3550,6 @@ namespace Dcat\Admin { * @method Show\Field|Collection createtime(string $label = null) * @method Show\Field|Collection updatetime(string $label = null) * @method Show\Field|Collection token(string $label = null) - * @method Show\Field|Collection market_id(string $label = null) * @method Show\Field|Collection admin_id(string $label = null) * @method Show\Field|Collection url(string $label = null) * @method Show\Field|Collection content(string $label = null) @@ -3556,7 +3579,6 @@ namespace Dcat\Admin { * @method Show\Field|Collection group_id(string $label = null) * @method Show\Field|Collection type(string $label = null) * @method Show\Field|Collection condition(string $label = null) - * @method Show\Field|Collection remark(string $label = null) * @method Show\Field|Collection ismenu(string $label = null) * @method Show\Field|Collection weigh(string $label = null) * @method Show\Field|Collection flag(string $label = null) @@ -3665,7 +3687,6 @@ namespace Dcat\Admin { * @method Show\Field|Collection weid(string $label = null) * @method Show\Field|Collection qq(string $label = null) * @method Show\Field|Collection dist(string $label = null) - * @method Show\Field|Collection address(string $label = null) * @method Show\Field|Collection industry1(string $label = null) * @method Show\Field|Collection industry2(string $label = null) * @method Show\Field|Collection from_user(string $label = null) @@ -3683,7 +3704,6 @@ namespace Dcat\Admin { * @method Show\Field|Collection is_notice_service(string $label = null) * @method Show\Field|Collection is_notice_boss(string $label = null) * @method Show\Field|Collection authority(string $label = null) - * @method Show\Field|Collection logo(string $label = null) * @method Show\Field|Collection src(string $label = null) * @method Show\Field|Collection src2(string $label = null) * @method Show\Field|Collection created_time(string $label = null) @@ -3737,12 +3757,10 @@ namespace Dcat\Admin { * @method Show\Field|Collection fe_dycode(string $label = null) * @method Show\Field|Collection xx_sn(string $label = null) * @method Show\Field|Collection tag_name(string $label = null) - * @method Show\Field|Collection sort(string $label = null) * @method Show\Field|Collection son_id(string $label = null) * @method Show\Field|Collection note(string $label = null) * @method Show\Field|Collection sn(string $label = null) * @method Show\Field|Collection simnum(string $label = null) - * @method Show\Field|Collection addtime(string $label = null) * @method Show\Field|Collection fx_details(string $label = null) * @method Show\Field|Collection tx_details(string $label = null) * @method Show\Field|Collection is_fx(string $label = null) @@ -3832,18 +3850,8 @@ namespace Dcat\Admin { * @method Show\Field|Collection waimai_pay_temp(string $label = null) * @method Show\Field|Collection dangmian_pay_temp(string $label = null) * @method Show\Field|Collection ziti_pay_temp(string $label = null) - * @method Show\Field|Collection introduce(string $label = null) - * @method Show\Field|Collection imgs(string $label = null) - * @method Show\Field|Collection coordinates(string $label = null) - * @method Show\Field|Collection poundage(string $label = null) - * @method Show\Field|Collection dn_poundage(string $label = null) - * @method Show\Field|Collection dm_poundage(string $label = null) - * @method Show\Field|Collection yd_poundage(string $label = null) - * @method Show\Field|Collection dada_number(string $label = null) - * @method Show\Field|Collection is_open_dada(string $label = null) - * @method Show\Field|Collection loudspeaker_imei(string $label = null) - * @method Show\Field|Collection dishes_menu_intro(string $label = null) - * @method Show\Field|Collection create_time(string $label = null) + * @method Show\Field|Collection mp_id(string $label = null) + * @method Show\Field|Collection deleted_at(string $label = null) * @method Show\Field|Collection sender(string $label = null) * @method Show\Field|Collection is_email(string $label = null) * @method Show\Field|Collection xd_tid(string $label = null)