效果如图:
第一步,在/api/extend.fun.php增加扩展函数:
function member_deposit($username) {
global $db;
$r = $db->get_one(“SELECt deposit FROM {$db->pre}member WHERe username=’$username'”);
return $r[deposit];
}
第二部,修改/template/default/tag/list-company.htm
{if member_deposit($t[username]) > 0}<i class=”g”>[{member_deposit($t[username])}{$DT[money_unit]}保证金]</i>{else}<i class=”o”>[未缴纳保证金]</i>{/if}<!–// 添加保证金 –>
company.css修改样式:
.list i.g{font-style: normal;color: green;}.list i.o{font-style: normal;color: orange;}.list i.v{font-style: normal;color:#406de8;}.list i.b{font-style: normal;}
这样就可以了。