相對(duì)模塊全部
今日的數(shù)據(jù):{$ci->db->where('status', 9)->where('DATEDIFF(from_unixtime(inputtime),now())=0')->count_all_results('1_模塊目錄_index')}
昨天的數(shù)據(jù):{$ci->db->where('status', 9)->where('DATEDIFF(now(), FROM_UNIXTIME(`inputtime`)) = 1')->count_all_results('1_模塊目錄_index')}
7天內(nèi)的數(shù)據(jù):{$ci->db->where('status', 9)->where('DATEDIFF(now() , FROM_UNIXTIME(`inputtime`)) <= 7')->count_all_results('1_模塊目錄_index')}
全部的數(shù)據(jù):{$ci->db->where('status', 9)->count_all_results('1_模塊目錄_index')}相對(duì)欄目全部
今日的數(shù)據(jù):{$ci->db->where('status', 9)->where('catid', 欄目id號(hào))->where('DATEDIFF(from_unixtime(inputtime),now())=0')->count_all_results('1_模塊目錄_index')}
昨天的數(shù)據(jù):{$ci->db->where('status', 9)->where('catid', 欄目id號(hào))->where('DATEDIFF(now(), FROM_UNIXTIME(`inputtime`)) = 1')->count_all_results('1_模塊目錄_index')}
7天內(nèi)的數(shù)據(jù):{$ci->db->where('status', 9)->where('catid', 欄目id號(hào))->where('DATEDIFF(now() , FROM_UNIXTIME(`inputtime`)) <= 7')->count_all_results('1_模塊目錄_index')}
全部的數(shù)據(jù):{$ci->db->where('status', 9)->where('catid', 欄目id號(hào))->count_all_results('1_模塊目錄_index')}自定義表的
今日的數(shù)據(jù):{$ci->db->where('DATEDIFF(from_unixtime(inputtime),now())=0')->count_all_results('表名稱自己改')}
昨天的數(shù)據(jù):{$ci->db->where('DATEDIFF(now(), FROM_UNIXTIME(`inputtime`)) = 1')->count_all_results('表名稱自己改')}
7天內(nèi)的數(shù)據(jù):{$ci->db->where('DATEDIFF(now() , FROM_UNIXTIME(`inputtime`)) <= 7')->count_all_results('表名稱自己改')}
全部的數(shù)據(jù):{$ci->db->count_all_results('表名稱自己改')}
inputtime 是時(shí)間字段
表名稱 自己根據(jù)實(shí)際數(shù)據(jù)來填寫當(dāng)前欄目下的文章數(shù)量
{$cat.total} 有緩存法
{$ci->db->where('catid', $catid)->count_all_results('1_news_index')}
無緩存法
文檔最后更新時(shí)間:2019-07-10 13:51:57