付费文档数量列表页显示
{eyou:assign name="typeid" value="$eyou.field.typeid"} {eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__archives WHERE restric_type= 2 AND typeid=$typeid' cachetime='-1'}{$field.count}{/eyou:sql}
当前栏目下的子栏目数量
{eyou:assign name="typeid" value="$eyou.field.typeid"} <!-- 栏目页显示数量,列表显示的话改$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}
设计师与其作品关联列表
{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"}{$field2.title}{/eyou:arcview} {/eyou:sql}
点赞插件内容页统计数量
{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}
易优cms统计某文章的下载数量
{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}
易优cms统计搜索结果页关键词文章数量
{eyou:assign name="keywords" value="$eyou.field.keywords"} <!--通过自定义变量assign获取关健词--> {eyou:sql sql='Select count(*) as AllNum from ey_archives where title like "%$keywords%" AND is_del = 0' cachetime='-1'} {$field.AllNum} <!--返回查询数量为allNum字段--> {/eyou:sql}
易优会员购买产品列表显示
{eyou:sql sql='SELECT ul.product_name,um.order_amount,um.add_time,u.nickname,u.head_pic FROM __PREFIX__shop_order AS um LEFT JOIN __PREFIX__users AS u on um.users_id = u.users_id LEFT JOIN __PREFIX__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'}{$field.nickname}¥{$field.order_amount}购买了{$field.product_name}[{$field.add_time|MyDate='Y-m-d H:i:s',###}]{/eyou:sql}
产品近6个月添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__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个月添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__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}
产品上周添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__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}
文章上周添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__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}
产品本周添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__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}
文章本周添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__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}
产品去年添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__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}
文章去年添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__archives WHERE status = 1 AND YEAR(FROM_UNIXTIME(ADD_TIME))=YEAR(date_sub(now(),INTERVAL 1 YEAR)) AND channel = 1' cachetime='-1'}{$field.count}{/eyou:sql}
产品今年添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__archives WHERE status = 1 AND YEAR(FROM_UNIXTIME(add_time))=YEAR(NOW()) AND channel = 2' cachetime='-1'}{$field.count}{/eyou:sql}
文章今年添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__archives WHERE status = 1 AND YEAR(FROM_UNIXTIME(add_time))=YEAR(NOW()) AND channel = 1' cachetime='-1'}{$field.count}{/eyou:sql}
产品上季度添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__archives WHERE status = 1 AND QUARTER(FROM_UNIXTIME(add_time))=QUARTER(DATE_SUB(now(),interval 1 QUARTER)) AND channel = 2' cachetime='-1'}{$field.count}{/eyou:sql}
文章上季度添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__archives WHERE status = 1 AND QUARTER(FROM_UNIXTIME(add_time))=QUARTER(DATE_SUB(now(),interval 1 QUARTER)) AND channel = 1' cachetime='-1'}{$field.count}{/eyou:sql}
产品本季度添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__archives WHERE status = 1 AND QUARTER(FROM_UNIXTIME(add_time))=QUARTER(now()) AND channel = 2' cachetime='-1'}{$field.count}{/eyou:sql}
文章本季度添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__archives WHERE status = 1 AND QUARTER(FROM_UNIXTIME(add_time))=QUARTER(now()) AND channel = 1' cachetime='-1'}{$field.count}{/eyou:sql}
产品上个月添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__archives WHERE status = 1 AND PERIOD_DIFF( date_format( now() , "%Y%m" ) , date_format( FROM_UNIXTIME(add_time), "%Y%m" ) ) =1 AND channel = 2' cachetime='-1'}{$field.count}{/eyou:sql}
文章上个月添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__archives WHERE status = 1 AND PERIOD_DIFF( date_format( now() , "%Y%m" ) , date_format( FROM_UNIXTIME(add_time), "%Y%m" ) ) =1 AND channel = 1' cachetime='-1'}{$field.count}{/eyou:sql}
产品本月添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__archives WHERE status = 1 AND DATE_FORMAT( FROM_UNIXTIME(add_time), "%Y%m") = DATE_FORMAT( CURDATE(), "%Y%m") AND channel = 2' cachetime='-1'}{$field.count}{/eyou:sql}
文章近本月添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__archives WHERE status = 1 AND DATE_FORMAT( FROM_UNIXTIME(add_time), "%Y%m") = DATE_FORMAT( CURDATE(), "%Y%m") AND channel = 1' cachetime='-1'}{$field.count}{/eyou:sql}
产品近30天添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__archives WHERE status = 1 AND date(FROM_UNIXTIME(add_time)) >= DATE_SUB(CURDATE(), INTERVAL 30 DAY) AND channel = 2' cachetime='-1'}{$field.count}{/eyou:sql}
文章近30天添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__archives WHERE status = 1 AND date(FROM_UNIXTIME(add_time)) >= DATE_SUB(CURDATE(), INTERVAL 30 DAY) AND channel = 1' cachetime='-1'}{$field.count}{/eyou:sql}
产品近7天添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__archives WHERE status = 1 AND date(FROM_UNIXTIME(add_time)) >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) AND channel = 2' cachetime='-1'}{$field.count}{/eyou:sql}
文章近7天添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__archives WHERE status = 1 AND date(FROM_UNIXTIME(add_time)) >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) AND channel = 1' cachetime='-1'}{$field.count}{/eyou:sql}
产品今日添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__archives WHERE status = 1 AND TO_DAYS(FROM_UNIXTIME(add_time)) = TO_DAYS(now()) AND channel = 2' cachetime='-1'}{$field.count}{/eyou:sql}
产品昨日添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__archives WHERE status = 1 AND TO_DAYS(now()) - TO_DAYS(FROM_UNIXTIME(add_time)) = 1 AND channel = 2' cachetime='-1'}{$field.count}{/eyou:sql}
文章昨日添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__archives WHERE status = 1 AND TO_DAYS(now()) - TO_DAYS(FROM_UNIXTIME(add_time)) = 1 AND channel = 1' cachetime='-1'}{$field.count}{/eyou:sql}
文章今日添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM __PREFIX__archives WHERE status = 1 AND TO_DAYS(FROM_UNIXTIME(add_time)) = TO_DAYS(now()) AND channel = 1' cachetime='-1'}{$field.count}{/eyou:sql}
易优会员升级列表显示
{eyou:sql sql='SELECT ul.level_name,um.money,um.add_time,u.nickname,u.head_pic FROM __PREFIX__users_money AS um LEFT JOIN __PREFIX__users AS u on um.users_id = u.users_id LEFT JOIN __PREFIX__users_level AS ul on ul.level_id = um.level_id WHERE um.cause_type = 0 AND um.status = 2 ORDER BY um.moneyid DESC LIMIT 0,10' cachetime='-1'}{$field.nickname}¥{$field.money}升级了{$field.level_name}[{$field.add_time|MyDate='Y-m-d H:i:s',###}]{/eyou:sql}
易优会员数量统计标签
{eyou:sql sql='SELECT count(users_id) AS count FROM __PREFIX__users WHERE is_activation = 1' cachetime='-1'}{$field.count}{/eyou:sql}