后台不能删除默认客户组
This commit is contained in:
parent
9d8c40a81b
commit
a1ee7cda6e
|
|
@ -79,6 +79,9 @@ class CustomerController extends Controller
|
|||
|
||||
public function destroy(Request $request, int $customerId)
|
||||
{
|
||||
if ($customerId == setting('base.default_customer_group_id')) {
|
||||
return json_fail(trans('customer_group.default_cannot_delete'));
|
||||
}
|
||||
CustomerRepo::delete($customerId);
|
||||
|
||||
return json_success(trans('common.deleted_success'));
|
||||
|
|
|
|||
|
|
@ -14,5 +14,6 @@ return [
|
|||
'customer_groups_create' => 'Create',
|
||||
'customer_groups_show' => 'Detail',
|
||||
'customer_groups_update' => 'Edit',
|
||||
'customer_groups_delete' => 'Delete'
|
||||
'customer_groups_delete' => 'Delete',
|
||||
'default_cannot_delete' => 'Default customer group cannot be deleted',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -15,4 +15,5 @@ return [
|
|||
'customer_groups_show' => '客户组详情',
|
||||
'customer_groups_update' => '更新客户组',
|
||||
'customer_groups_delete' => '删除客户组',
|
||||
'default_cannot_delete' => '默认客户组不能删除',
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in New Issue