table("datalog.app_user_visit_list") // ->where("version","1.1.1") // ->where("appid","wx3e6bb0f55902391b") // ->distinct() // ->pluck('user_id'); // $users = DB::connection("mysql_datalog") // ->table('datalog.app_visit_user') // ->whereIn('user_id',$users) // ->pluck('uid'); $users = DB::table('ta_users')->pluck('uid'); foreach ($users as $uid) { $user = UserModel::find($uid); fputcsv($fp, [ json_encode($user->getAuth()), ]); } fclose($fp); $file = new File($local_file); $file = Storage::disk('oss')->putFileAs($path, $file, $uuid . '.' . $file->getExtension()); $fileUrl = Storage::disk('oss')->url($file); dd($fileUrl); return $fileUrl; } }