linwu 2 年之前
父节点
当前提交
f2ffcbdf79
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/mainapp/controller/My.php

+ 2 - 2
app/mainapp/controller/My.php

@@ -171,14 +171,14 @@ class My extends BaseController
         $workerall = WorkerModel::where('userid', '=', $user->id)->select();
         $agentall  = AgentModel::where('userid', '=', $user->id)->select();
         $brokerall = BrokerModel::where('userid', '=', $user->id)->select();
-        $resident  = ResidentModel::where('userid', '=', $user->id)->find();
+        $resident  = ResidentModel::where('userid', '=', $user->id)->findOrEmpty();
         page_result(0, "", [
             'param'     => $param,
             'user'      => $user,
             'workerall' => $workerall->isEmpty() ? null : $workerall,
             'agentall'  => $agentall->isEmpty() ? null : $agentall,
             'brokerall' => $brokerall->isEmpty() ? null : $brokerall,
-            'resident'  => $resident->isEmpty() ? null : $resident,
+            'resident'  => empty($resident) ? null : $resident,
         ]);
     }