$item) { if ($key > 1) { $mobile = $item; $shopList = ShopClass::getAllByCondition(['mobile' => $mobile], null, '*', null, true); if (!empty($shopList)) { foreach ($shopList as $shop) { $merchantName = $shop->merchantName ?? ''; if (!empty($merchantName)) { SjClass::deleteByCondition(['name' => $merchantName]); } $shop->delete(); } } ApplyClass::deleteByCondition(['mobile' => $mobile]); $adminList = AdminClass::getAllByCondition(['mobile' => $mobile], null, '*', null, true); if (!empty($adminList)) { foreach ($adminList as $admin) { $adminId = $admin->id ?? 0; ShopAdminClass::deleteByCondition(['adminId' => $adminId]); $admin->delete(); } } } } } }