留言列表显示
2022-08-11 加入收藏
{eyou:php} $a = \think\Db::name('guestbook')->limit('0,10')->order('aid desc')->select(); $attr_list = array(); foreach ($a as $key => $val) { $aid = \think\Db::name('guestbook_attr')->where('aid',$val['aid'])->select(); $attr_lists = array(); foreach ($aid as $k => $v) { $attr_lists[$v['attr_id']] = $v['attr_value']; } $attr_lists['299'] = $val['add_time']; $attr_list[] = $attr_lists; } foreach ($attr_list as $key => $val) { $time = date('Y-m-d H:i:s',$val['299']); $phone = str_split($val['28']); $moblie = array(); foreach ($phone as $k => $v) { if ($k > 2 && 7 > $k) { $moblie[] = '*'; } else { $moblie[] = $v; } } $moblies = implode('', $moblie); echo '<li>'; echo '<div class="sli_item">'; echo '<div>'; echo '<div class="announ_tit">实时预约信息</div>'; echo '<i>'.$val['27'].'</i> <i>手机号: '.$moblies.'</i> <i>预约服务:'.$val['26'].'</i> <i>'.$time.'</i>'; echo '</div>'; echo '</div>'; echo '</li>'; } {/eyou:php}