各类知识收集,PHP技术分享与解决方案各类知识收集,PHP技术分享与解决方案各类知识收集,PHP技术分享与解决方案

Str Tom,为分享PHP技术和解决方案,贡献一份自己的力量!
收藏本站(不迷路),每天更新好文章!
当前位置:首页 > CMS教程 > dedecms

dede会员列表调用适用于企业、个人

管理员 2015-05-13
dedecms
115
调用12个企业会员 按 注册时间排序

代码如下:
{dede:sql sql='select * from dede_member where mtype="企业" order by mid limit 0,12'}
<a href=../member/index.php?uid=[field:userid/] target='_blank'>[field:uname/]</a>
{/dede:sql}

调用12个个人会员 按 注册时间排序

代码如下:
{dede:sql sql='select * from dede_member where mtype="个人" order by mid limit 0,12'}
<a href=../member/index.php?uid=[field:userid/] target='_blank'>[field:uname/]</a>
{/dede:sql}

详解
使用dede的sql标签
sql语句

代码如下:
select * from dede_member where mtype="个人" order by mid limit 0,12
mtype="个人" 判断是否为个人类型
order by mid 按mid(注册的ID编号) 排列
limit 0,12 从第0条数据开始读取 读取12条后返回

相关调用
调取所有会员中的12个

代码如下:
{dede:sql sql='select * from dede_member order by mid limit 0,12'}
<a href=../member/index.php?uid=[field:userid/] target='_blank'>[field:uname/]</a>
{/dede:sql}

调取所有会员中的12个 按最后登录时间排序

代码如下:
{dede:sql sql='select * from dede_member order by logintime limit 0,12'}
<a href=../member/index.php?uid=[field:userid/] target='_blank'>[field:uname/]</a>
{/dede:sql}

调取12个上传了头像的会员 按最后登录时间排序 并显示出他们的头像

代码如下:
{dede:sql sql='select * from dede_member where length(face)>0 order by logintime limit 0,12'}
<a href=../member/index.php?uid=[field:userid/] target='_blank'><img src=[field:face/] /></a>
{/dede:sql}
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

扫码关注

qrcode

QQ交谈

回顶部

关闭 运行信息( 0.1013 秒):
[系统信息]
错误警告 [文件 /www/wwwroot/www.niuyn.cn/cache/index/show_article_1a3699dcfa72ea7557baeaa1222181d7.tpl.php 中,第 497 行] :Use of undefined constant thumb - assumed 'thumb' (this will throw an Error in a future version of PHP)
错误警告 [文件 /www/wwwroot/www.niuyn.cn/cache/index/show_article_1a3699dcfa72ea7557baeaa1222181d7.tpl.php 中,第 497 行] :Use of undefined constant thumb - assumed 'thumb' (this will throw an Error in a future version of PHP)
错误警告 [文件 /www/wwwroot/www.niuyn.cn/cache/index/show_article_1a3699dcfa72ea7557baeaa1222181d7.tpl.php 中,第 497 行] :Use of undefined constant thumb - assumed 'thumb' (this will throw an Error in a future version of PHP)
错误警告 [文件 /www/wwwroot/www.niuyn.cn/cache/index/show_article_1a3699dcfa72ea7557baeaa1222181d7.tpl.php 中,第 497 行] :Use of undefined constant thumb - assumed 'thumb' (this will throw an Error in a future version of PHP)
错误警告 [文件 /www/wwwroot/www.niuyn.cn/cache/index/show_article_1a3699dcfa72ea7557baeaa1222181d7.tpl.php 中,第 497 行] :Use of undefined constant thumb - assumed 'thumb' (this will throw an Error in a future version of PHP)
错误警告 [文件 /www/wwwroot/www.niuyn.cn/cache/index/show_article_1a3699dcfa72ea7557baeaa1222181d7.tpl.php 中,第 497 行] :Use of undefined constant thumb - assumed 'thumb' (this will throw an Error in a future version of PHP)
错误警告 [文件 /www/wwwroot/www.niuyn.cn/cache/index/show_article_1a3699dcfa72ea7557baeaa1222181d7.tpl.php 中,第 497 行] :Use of undefined constant thumb - assumed 'thumb' (this will throw an Error in a future version of PHP)
错误警告 [文件 /www/wwwroot/www.niuyn.cn/cache/index/show_article_1a3699dcfa72ea7557baeaa1222181d7.tpl.php 中,第 497 行] :Use of undefined constant thumb - assumed 'thumb' (this will throw an Error in a future version of PHP)
错误警告 [文件 /www/wwwroot/www.niuyn.cn/cache/index/show_article_1a3699dcfa72ea7557baeaa1222181d7.tpl.php 中,第 497 行] :Use of undefined constant thumb - assumed 'thumb' (this will throw an Error in a future version of PHP)
错误警告 [文件 /www/wwwroot/www.niuyn.cn/cache/index/show_article_1a3699dcfa72ea7557baeaa1222181d7.tpl.php 中,第 497 行] :Use of undefined constant thumb - assumed 'thumb' (this will throw an Error in a future version of PHP)
错误警告 [文件 /www/wwwroot/www.niuyn.cn/cache/index/show_article_1a3699dcfa72ea7557baeaa1222181d7.tpl.php 中,第 497 行] :Use of undefined constant thumb - assumed 'thumb' (this will throw an Error in a future version of PHP)
[SQL语句]
SELECT * FROM `www_niuyn_cn` . `bk_article` WHERE (id = '66906') LIMIT 1; [ RunTime:0.000224s ]
UPDATE `www_niuyn_cn` . `bk_article` SET `click` = `click`+1 WHERE (id = '66906'); [ RunTime:0.003377s ]
SELECT title,url FROM `www_niuyn_cn` . `bk_article` WHERE (id< '66906' AND status = '1' AND catid = '506') ORDER BY id DESC LIMIT 1; [ RunTime:0.000198s ]
SELECT title,url FROM `www_niuyn_cn` . `bk_article` WHERE (id> '66906' AND status = '1' AND catid = '506') ORDER BY id ASC LIMIT 1; [ RunTime:0.000163s ]
SELECT catid,catname,arrchildid,pclink,target FROM `www_niuyn_cn` . `bk_category` WHERE siteid = 0 AND `display`=1 AND parentid=0 ORDER BY listorder ASC LIMIT 20; [ RunTime:0.000255s ]
SELECT modelid,catid,id,title,inputtime,url,thumb FROM `www_niuyn_cn` . `bk_all_content` WHERE (siteid = '0' AND status = '1') ORDER BY allid DESC LIMIT 5; [ RunTime:0.000177s ]
SELECT title,url,updatetime,color,description FROM `www_niuyn_cn` . `bk_article` WHERE status=1 ORDER BY RAND() LIMIT 8; [ RunTime:0.074741s ]
SELECT url,logo,name FROM `www_niuyn_cn` . `bk_link` WHERE siteid = 0 AND status = 1 ORDER BY listorder ASC, id DESC LIMIT 20; [ RunTime:0.000313s ]
[其他信息]
WEB服务器:nginx/1.24.0
PHP版本:7.4.33
路由信息:模块( index ),控制器( index ),方法( show ),参数( catid=506&id=66906 )
框架版本:2.9 查看新版