This commit is contained in:
parent
4e39972676
commit
7a2b89fb29
|
|
@ -11,8 +11,9 @@
|
|||
|
||||
namespace Beike\Admin\Repositories;
|
||||
|
||||
use Beike\Admin\Http\Resources\AdminUserDetail;
|
||||
use Beike\Models\AdminUser;
|
||||
use Beike\Admin\Http\Resources\AdminUserDetail;
|
||||
use Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException;
|
||||
|
||||
class AdminUserRepo
|
||||
{
|
||||
|
|
@ -81,9 +82,13 @@ class AdminUserRepo
|
|||
* 删除后台用户
|
||||
*
|
||||
* @param $adminUserId
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function deleteAdminUser($adminUserId)
|
||||
{
|
||||
if ($adminUserId == 1) {
|
||||
throw new NotAcceptableHttpException(trans('admin/customer.cannot_delete_root'));
|
||||
}
|
||||
$adminUser = AdminUser::query()->find($adminUserId);
|
||||
$adminUser->delete();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,9 +70,6 @@ class CustomerRepo
|
|||
*/
|
||||
public static function delete($id)
|
||||
{
|
||||
if ($id == 1) {
|
||||
throw new \Exception(trans('admin/customer.cannot_delete_root'));
|
||||
}
|
||||
Customer::query()->find($id)->delete();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue