search

Home  >  Q&A  >  body text

How does ThinkPhp output second- and third-level columns in a tree shape?

I want to implement the column call of the following tree structure:

360截图16660101677647.png

How to write the background controller, my database is as follows:

360截图16550428537093.png

Who can help me solve this problem

为梦兼程为梦兼程2028 days ago1178

reply all(1)I'll reply

  • BLANK

    BLANK2019-04-27 09:45:43

    The simplest idea: query the records with pid 0 in the database and then query the sub-columns in a loop. The number of layers required is just a few loops

    reply
    0
  • Cancelreply