shish 4 년 전
부모
커밋
101b0876f4
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      console/controllers/SjController.php

+ 5 - 3
console/controllers/SjController.php

@@ -36,9 +36,11 @@ class SjController extends Controller
                 }
                 ApplyClass::deleteByCondition(['mobile' => $mobile]);
                 $admin = AdminClass::getByCondition(['mobile' => $mobile], true);
-                $adminId = $admin->id ?? 0;
-                StaffClass::deleteByCondition(['adminId' => $adminId]);
-                $admin->delete();
+                if (!empty($admin)) {
+                    $adminId = $admin->id ?? 0;
+                    StaffClass::deleteByCondition(['adminId' => $adminId]);
+                    $admin->delete();
+                }
             }
         }
     }