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

laravel的嵌套循环怎么写呢?

WBOY
Release: 2016-06-06 20:19:57
Original
1569 people have browsed it

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

回复内容:

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

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

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

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template