{eyou:assign name="typeid" value="$eyou.field.typeid"}
{eyou:sql sql='SELECT count(aid) AS count FROM ey_archives WHERE restric_type= 2 AND typeid=$typeid' cachetime='-1'}{$field.count}{/eyou:sql}
當(dāng)前欄目下的子欄目數(shù)量
{eyou:assign name="typeid" value="$eyou.field.typeid"}//欄目頁顯示數(shù)量,列表顯示的話改$field.typeid
{eyou:sql sql='Select count(*) as AllNum from ey_arctype where parent_id = $typeid AND is_del = 0 AND status = 1' cachetime='-1'}
{$field.AllNum}
{/eyou:sql}
設(shè)計(jì)師與其作品關(guān)聯(lián)列表
{eyou:assign name='writer' value='$eyou.field.author'/}
<!-- 獲取作者名稱變量 -->
{eyou:sql sql='SELECT aid,author,litpic FROM ey_archives WHERE
author = "$writer" AND typeid="345" limit 10' cachetime='-1'}
{eyou:arcview aid="$field.aid" id="field2"}
<li><a href="{$field2.arcurl}"><img src="{$field2.litpic}">{$field2.title}</a></li>
{/eyou:arcview}
{/eyou:sql}
點(diǎn)贊插件內(nèi)容頁統(tǒng)計(jì)數(shù)量
{eyou:assign name="aid" value="$eyou.field.aid"}
{eyou:sql sql='Select count(*) as AllNum from ey_weapp_zan where aid = $aid' cachetime='-1'}
{$field.AllNum}
{/eyou:sql}
易優(yōu)cms統(tǒng)計(jì)某文章的下載數(shù)量
{eyou:assign name="aid" value="$eyou.field.aid"}
{eyou:sql sql='Select count(*) as AllNum from ey_download_log where aid = $aid' cachetime='-1'}
{$field.AllNum}
{/eyou:sql}
{eyou:assign name="keywords" value="$eyou.field.keywords"}
<!--通過自定義變量assign獲取關(guān)健詞-->
{eyou:sql sql='Select count(*) as AllNum from ey_archives where title like "%$keywords%" AND is_del = 0' cachetime='-1'}
{$field.AllNum}
<!--返回查詢數(shù)量為allNum字段-->
{/eyou:sql}
易優(yōu)會員購買產(chǎn)品列表顯示
{eyou:sql sql='SELECT ul.product_name,um.order_amount,um.add_time,u.nickname,u.head_pic FROM ey_shop_order AS um LEFT JOIN ey_users AS u on um.users_id = u.users_id LEFT JOIN ey_shop_order_details AS ul on ul.order_id = um.order_id WHERE um.order_status = 3 ORDER BY um.moneyid DESC LIMIT 0,10' cachetime='-1'}
<li>
<img src="{$field.head_pic}">
<a><strong>{$field.nickname}</strong><em>¥{$field.order_amount}</em>購買了<span>{$field.product_name}</span><i>[{$field.add_time|MyDate='Y-m-d H:i:s',###}]</i></a>
</li>
{/eyou:sql}
產(chǎn)品近6個(gè)月添加數(shù)量統(tǒng)計(jì)標(biāo)簽
{eyou:sql sql='SELECT count(aid) AS count FROM ey_archives WHERE status = 1 AND FROM_UNIXTIME(ADD_TIME) BETWEEN DATE_SUB(now(),INTERVAL 6 month) and now() AND channel = 2' cachetime='-1'}{$field.count}{/eyou:sql}
文章近6個(gè)月添加數(shù)量統(tǒng)計(jì)標(biāo)簽
{eyou:sql sql='SELECT count(aid) AS count FROM ey_archives WHERE status = 1 AND FROM_UNIXTIME(ADD_TIME) BETWEEN DATE_SUB(now(),INTERVAL 6 month) and now() AND channel = 1' cachetime='-1'}{$field.count}{/eyou:sql}
產(chǎn)品上周添加數(shù)量統(tǒng)計(jì)標(biāo)簽
{eyou:sql sql='SELECT count(aid) AS count FROM ey_archives WHERE status = 1 AND YEARWEEK(date_format(FROM_UNIXTIME(ADD_TIME),"%Y-%m-%d")) = YEARWEEK(now())-1 AND channel = 2' cachetime='-1'}{$field.count}{/eyou:sql}
文章上周添加數(shù)量統(tǒng)計(jì)標(biāo)簽
{eyou:sql sql='SELECT count(aid) AS count FROM ey_archives WHERE status = 1 AND YEARWEEK(date_format(FROM_UNIXTIME(ADD_TIME),"%Y-%m-%d")) = YEARWEEK(now())-1 AND channel = 1' cachetime='-1'}{$field.count}{/eyou:sql}
產(chǎn)品本周添加數(shù)量統(tǒng)計(jì)標(biāo)簽
{eyou:sql sql='SELECT count(aid) AS count FROM ey_archives WHERE status = 1 AND YEARWEEK(date_format(FROM_UNIXTIME(ADD_TIME),"%Y-%m-%d")) = YEARWEEK(now()) AND channel = 2' cachetime='-1'}{$field.count}{/eyou:sql}
文章本周添加數(shù)量統(tǒng)計(jì)標(biāo)簽
{eyou:sql sql='SELECT count(aid) AS count FROM ey_archives WHERE status = 1 AND YEARWEEK(date_format(FROM_UNIXTIME(ADD_TIME),"%Y-%m-%d")) = YEARWEEK(now()) AND channel = 1' cachetime='-1'}{$field.count}{/eyou:sql}
產(chǎn)品去年添加數(shù)量統(tǒng)計(jì)標(biāo)簽
{eyou:sql sql='SELECT count(aid) AS count FROM ey_archives WHERE status = 1 AND YEAR(FROM_UNIXTIME(ADD_TIME))=YEAR(date_sub(now(),INTERVAL 1 YEAR)) AND channel = 2' cachetime='-1'}{$field.count}{/eyou:sql}