Home >Backend Development >PHP Tutorial >laravel的嵌套循环怎么写呢?

laravel的嵌套循环怎么写呢?

WBOY
WBOYOriginal
2016-06-06 20:19:571540browse

laravel的嵌套循环怎么写呢,类似于输出省市两级菜单,数据表是分开的,两张表。主要是里面那个循环不知道咋写,写了运行不了。

回复内容:

laravel的嵌套循环怎么写呢,类似于输出省市两级菜单,数据表是分开的,两张表。主要是里面那个循环不知道咋写,写了运行不了。

建议你用SQL语句的join或leftjoin合并表来完成该功能

你说的是输出的时候?还是查询数据的时候?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn