补充权限
parent
c2210845e7
commit
118ecbddbc
|
|
@ -41,7 +41,7 @@ class DealerController extends AdminController
|
|||
});
|
||||
$grid->column('is_sale')
|
||||
->if(function () {
|
||||
return Admin::user()->can('dcat.admin.dealers.edit');
|
||||
return Admin::user()->can('dcat.admin.dealers.update');
|
||||
})
|
||||
->then(function (Column $column) {
|
||||
$column->switch();
|
||||
|
|
@ -51,7 +51,7 @@ class DealerController extends AdminController
|
|||
});
|
||||
$grid->column('is_manager')
|
||||
->if(function () {
|
||||
return Admin::user()->can('dcat.admin.dealers.edit');
|
||||
return Admin::user()->can('dcat.admin.dealers.update');
|
||||
})
|
||||
->then(function (Column $column) {
|
||||
$column->switch();
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ use App\Models\DealerManageSubsidy;
|
|||
use App\Models\DealerManageSubsidyLog;
|
||||
use App\Models\DealerPurchaseSubsidy;
|
||||
use App\Models\DealerPurchaseSubsidyLog;
|
||||
use Dcat\Admin\Admin;
|
||||
use Dcat\Admin\Form;
|
||||
use Dcat\Admin\Grid;
|
||||
use Dcat\Admin\Http\Controllers\AdminController;
|
||||
|
|
@ -180,7 +181,7 @@ class DealerEarningController extends AdminController
|
|||
->tools(function (Show\Tools $tools) use ($show) {
|
||||
$tools->disableEdit();
|
||||
$tools->disableDelete();
|
||||
if ($show->model()->status == DealerEarningStatus::Pending) {
|
||||
if ($show->model()->status == DealerEarningStatus::Pending && Admin::user()->can('dcat.admin.dealer_earnings.pay')) {
|
||||
if (!$show->model()->payer_id || $show->model()->payer_id == 1) {
|
||||
$tools->append(new DealerEarningPay());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -282,6 +282,33 @@ class AdminPermissionSeeder extends Seeder
|
|||
'name' =>'导入记录',
|
||||
'curd'=>['index'],
|
||||
],
|
||||
'dealers' =>[
|
||||
'name' =>'经销商管理',
|
||||
'curd'=>['index, show, update'],
|
||||
'children'=>[
|
||||
'edit_lvl'=>['name' =>'修改经销商等级'],
|
||||
'bonds'=>['name' =>'填写保证金'],
|
||||
],
|
||||
],
|
||||
'dealer_products'=>[
|
||||
'name'=>'批零商品',
|
||||
'curd'=> true,
|
||||
],
|
||||
'dealer_orders'=>[
|
||||
'name' =>'批零订单',
|
||||
'curd' => ['index', 'show'],
|
||||
'children' =>[
|
||||
'paid'=>['name' =>'确认收款'],
|
||||
'shipping'=>['name' =>'确认发货'],
|
||||
],
|
||||
],
|
||||
'dealer-earnings'=>[
|
||||
'name' =>'资金管理',
|
||||
'curd' => ['index', 'show'],
|
||||
'children' => [
|
||||
'pay'=>['name' =>'确认打款'],
|
||||
],
|
||||
],
|
||||
];
|
||||
try {
|
||||
DB::begintransaction();
|
||||
|
|
|
|||
Loading…
Reference in New Issue