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]);
                 ApplyClass::deleteByCondition(['mobile' => $mobile]);
                 $admin = AdminClass::getByCondition(['mobile' => $mobile], true);
                 $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();
+                }
             }
             }
         }
         }
     }
     }