wupengfei 2 tahun lalu
induk
melakukan
02767f5e33
2 mengubah file dengan 3 tambahan dan 1 penghapusan
  1. 1 1
      application/api/controller/UserLeave.php
  2. 2 0
      config/database.php

+ 1 - 1
application/api/controller/UserLeave.php

@@ -58,7 +58,7 @@ class UserLeave extends Base
         if(empty($request_param['start_date']) || empty($request_param['end_date'])) $this->error('请选择请假期');
         if(empty($request_param['type'])) $this->error('请选择请假类型');
         if(empty($request_param['user_id'])) $request_param['user_id'] = $this->user_id;
-        $flow = LeaveFlow::order('sort asc ,id asc')->select();
+        $flow = LeaveFlow::order('sort asc ,id asc')->select()->toArray();
         $flow_user = array_column($flow,'user_id');
         $found_key = array_search($request_param['user_id'], array_column($flow_user, 'user_id'));
         var_dump($found_key);

+ 2 - 0
config/database.php

@@ -36,4 +36,6 @@ return [
     'rw_separate' => false,
     // 前缀
     'prefix'      => 'dd_',
+    // 返回类型
+    'resultset_type'      => 'array',
 ];