主頁 > 網(wǎng)站建設(shè) > 建站知識 > DEDE常用的幾個SQL標(biāo)記(會員中心數(shù)據(jù)調(diào)用)

DEDE常用的幾個SQL標(biāo)記(會員中心數(shù)據(jù)調(diào)用)

POST TIME:2018-03-15 21:49

調(diào)用會員發(fā)布的最新10條文檔
{dede:sql sql="SELECT f.title,f.url,m.uname,m.id as uid
FROM dede_archives a left join dede_full_search f on a.ID = f.aid
left join dede_member m on a.memberID = m.ID
WHERE memberID >0
ORDER BY `sortrank` DESC
LIMIT 0 , 10"}
<a href='[field:url/]'>[field:title function="cn_substr(@me,50)"/]</a>
<a href='[field:global name='cfg_cmspath'/]/member/?[field:uid/]/'>[field:uname/]</a>
{/dede:sql}
 
推薦企業(yè)
{dede:sql sql="SELECT m.ID,m.type,m.userid,m.matt,c.id,c.comname
FROM dede_member m
left join dede_member_cominfo c on m.ID = c.id
where m.type = 1 and m.matt = 1
LIMIT 0 , 10"}
<a href='[field:global name='cfg_cmspath'/]/member/?[field:userid/]/'>[field:comname/]</a>
{/dede:sql}
最新企業(yè)調(diào)用
{dede:sql sql="SELECT m.ID, m.type, m.userid,c.id, c.comname
FROM dede_member m
LEFT JOIN dede_member_cominfo c ON m.ID = c.id
WHERE m.type =1
ORDER BY `m`.`ID` DESC
LIMIT 0 , 10 "}
<a href='[field:global name='cfg_cmspath'/]/member/?[field:userid/]/'>[field:comname/]</a>
{/dede:sql}
推薦會員(帶用戶頭像)調(diào)用方法
推薦企業(yè)
{dede:sql sql="SELECT m.ID,m.type,m.userid,m.matt,m.spacep_w_picpath,c.id,c.comname
FROM dede_member m left join dede_member_cominfo c on m.ID = c.id
where m.type = 1 and m.matt = 1
LIMIT 0 , 5"}
頭像:<img src="[field:spacep_w_picpath runphp='yes']
if(!@me)@me = 'http://bbs.dedecms.com/p_w_picpath/post/smile/default/14.gif';
[/field:spacep_w_picpath]" />
用戶名:<a href='[field:global name='cfg_cmspath'/]/member/?[field:userid/]/'>[field:comname/]</a>
{/dede:sql}
推薦會員
{dede:sql sql="SELECT ID,type,userid,uname,matt,spacep_w_picpath
FROM dede_member
where matt = 1 and type=0
LIMIT 0 , 10"}
頭像:<img src="[field:spacep_w_picpath runphp='yes']
if(!@me)@me = 'http://bbs.dedecms.com/p_w_picpath/post/smile/default/14.gif';
[/field:spacep_w_picpath]" />
用戶名:<a href='[field:global name='cfg_cmspath'/]/member/?[field:userid/]/'>[field:uname/]</a>
{/dede:sql}
為用戶頭像圖片 [field:spacep_w_picpath runphp='yes']
if(!@me)@me = 'http://bbs.dedecms.com/p_w_picpath/post/smile/default/14.gif';
[/field:spacep_w_picpath]
5個推薦企業(yè) 包含企業(yè)簡介
{dede:sql sql="SELECT m.userid,m.comname,c.cominfo
FROM dede_member m left join dede_member_cominfo c on m.ID = c.id
where m.type = 1 and m.matt = 1
LIMIT 0 , 5"}
 
企業(yè)名稱:<a href='[field:global name='cfg_cmspath'/]/member/?[field:userid/]/'>[field:comname/]</a>
企業(yè)簡介:[field:cominfo function="cn_substr(ClearHtml(@me),100)"/]
{/dede:sql}
最新招聘信息
{dede:sql sql="SELECT * FROM dede_jobs ORDER BY pubdate DESC LIMIT 0 , 10"}
<a href="/member/index.php?id=3">[field:name/]</a>招聘<a href="/member/index.php?id=[field:memberID/]&type=job&jobid=[field:id/]">[field:job/]</a><br/>
{/dede:sql}



收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266