您的位置:首页 > Web前端

laravel关联查询及一些实用前端代码

2018-03-30 13:55 246 查看
当查询条件在其他表时,比如查询的名字在其关联的表里,不在主表,
这时关联的表有这个名字的数据有哪些呢,这时就执行下面的语句可以关联到附表

if (!empty($children_name)) {
$query->whereHas('customer', function ($q) use ($children_name) {
$q->where('children_name', 'like', '%' . $children_name . '%');
});
}
<img src="#" onerror="this.onerror = null; this.src = '{{ "fronts/img/timg.jpg" }}'">
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ph html