request->get('id'); $shopAdmin = ShopAdminClass::getAdminInfo($id); if (empty($shopAdmin)) { util::fail('没有找到员工'); } if (getenv('YII_ENV', 'local') == 'production') { util::fail('生产环境不能执行删除操作'); } $adminId = $shopAdmin['adminId'] ?? 0; $sjId = $shopAdmin['merchantId'] ?? 0; $sj = SjClass::getById($sjId, true); if (!empty($sj)) { $sj->delete(); } $apply = ApplyClass::getByCondition(['sjId' => $sjId], true); if (!empty($apply)) { $apply->delete(); } $admin = AdminClass::getById($adminId); if (!empty($admin)) { $admin->delete(); } $shopAdmin = ShopAdminClass::getById($id); if (!empty($shopAdmin)) { $shopAdmin->delete(); } util::complete(); } }