如何解决如何在一个foreach视图中显示3种不同的数据?
这是我查看的代码
@foreach ($pops as $pop )
<div class="top-margin">
<div class="barcode">
<div class="bar-head" style="height:276px; background:red;">
<div class="desc">
<h2><font color="white">SERBA HEMAT</font></h2>
</div>
</div>
<div class="bar-body-1">
<div class="d-flex">
<div class="qrcode">{{ QRCode::text3($pop->till_code.'_NO PAC')->svg3()}}</div>
<div class="line"></div>
<div class="brand">
<h3>{{ $pop->brand_desc }}</h3>
<div class="artdesc">{{ $pop->long_desc }}</div>
</div>
</div>
</div>
<div class="rp-1">Rp.</div>
<div class="center">
<div class="prices"><h1>{{ number_format($pop->promo_price,'','.') }}</h1></div>
</div>
<div class="bar-footer">
<div class="center">
<div class="periode">Berlaku s/d {{ $pop->promo_date == '' ? '' : date('d M Y',strtotime($pop->promo_date)) }}</div>
</div>
</div>
</div>
</div>
</div>
@endforeach
这是我的结果
我如何在下面得到这样的结果?
这是我的控制器
$data['pops'] = DB::select("SELECT distinct pop_manuals.till_code,pop_manuals.initial_store,pop_manuals.quantity,pop_manuals.promo_date,pop_manuals.promo_from_price,pop_manuals.promo_to_price,pop_manuals.promo_price,pop_manuals.no,users.id,users.initial_store,article_gold.store_desc,article_gold.brand_desc,article_gold.long_desc,article_gold.sales_price
FROM pop_manuals
LEFT JOIN users ON users.initial_store = pop_manuals.initial_store
LEFT JOIN article_gold ON article_gold.till_code = pop_manuals.till_code
WHERE pop_manuals.initial_store = '$initial_store' AND article_gold.store_desc = '$initial_store' AND users.id = '$id'
ORDER BY pop_manuals.till_code ASC;");
请帮助我,谢谢!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。