<?php $type_array = ['1'=>'/套', '2'=>'/件', '3'=>'/片', '4'=>'/块', '5'=>'/沱', '6'=>'/颗', '7'=>'/盒', '8'=>'/提' ]; ?> 
    {pc:get sql="SELECT a.title, a.id, a.model_id,a.image, b.base_price, b.base_unit, b.update_time, b.rise_or_fall, b.udorder, b.update_numbers, b.thrid_url,b.udorder,b.priceud FROM 表一 as a left join 表二 as b on a.id = b.id where a.model_id=2 order by update_numbers desc" num="15" cache="3600" dbsource="hangqing" return="data" }
    <ul>
    {loop $data $key $val}
        <li>
            <a title="{$val['title']}" target="_blank" href="/a/{$val['id']}.html">
                <img src="{$val['image']}" />
                <?php
                    if($val['base_price'] >= 100000){
                        $val['base_price'] = $val['base_price']/10000 .'万';
                    }
                ?>
                <p style="color:red;text-align: center;">¥{$val['base_price']}{$type_array[$val['base_unit']]}</p>
                {if $val['rise_or_fall'] == 0}
                <span>升跌:<p style="display: inline-block;">¥{$val['priceud']}@{$val['udorder']}%</p></span>
                {/if}
                {if $val['rise_or_fall'] == 1}
                <span>升跌:<p style="display: inline-block; color:red;">升¥{$val['priceud']}↑{$val['udorder']}%</p></span>
                {/if}
                {if $val['rise_or_fall'] == 2}
                <span>升跌:<p style="display: inline-block; color:#4CAF50;">降¥{$val['priceud']}↓{$val['udorder']}%</p></span>
                {/if}
                <span>{$val['title']}</span>
            </a>
        </li>
    {/loop}
    </ul>
{/pc}
点赞(1) 打赏

Comment list 共有 0 条评论

暂无评论

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部