How to optimize the loading speed of easyui tree table

I use easyui"s tree table, whose data is provided by a php page. The php page contains a large number of judgments, including permissions, whether some functions are displayed, querying name according to uid, and so on. There is no problem with less data, but loading is slow when there is more data.

the following figure is a small part of the php page. I know the code sucks. I do the front end, but the back end is not very good at writing. Please help me to analyze if this is not the right thing to do. Is there a better idea, or how can it be optimized on this basis? Thank you!

Mar.13,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3de7f-2c3b7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3de7f-2c3b7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?