ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
```` 遍历数组 @foreach($brand as $v)   <a href='/brandss/seeshops?id={{$v->id}}'><img src="/public{{$v->image}}" style="height: 300px;width: 300px"></a></img>   <a href="/brandss/seeshops?id={{$v->id}}">{{$v->brandName}}</a> @endforeach ============ ============ 数据库查询: $cates = DB::table('tp_article')->where('odds','=', $pid)->get(); public static function getCatesByDiGui($pid) { //获取分类 // return 'sss'; $cates = DB::table('tp_article')->where('odds','=', $pid)->get(); //遍历分类信息 var_dump($cates); exit; // $cates = DB::table('tp_article')->where('odds','=', '$pid')->get(); $sub_cate = []; foreach($cates as $k=>$v) { $v->sub_cate = self::getCatesByDiGui($v->id); $sub_cate[] = $v; } return $sub_cate; } ======================== Db::table('think_user') ->alias('a') ->join('think_dept b ','b.user_id= a.id') ->select();