|
1)、在網(wǎng)站根目錄打開 /index.php 查找 assign_dynamic('index');
在下面添加代碼: $sql="select count(*) as goods_all from ". $ecs->table('goods'); //商品總數(shù) $smarty->assign('goodsnum_all',$db->getOne($sql)); $time_month=mktime(0,0,0,date('m')-1,1,date('Y')); $sql="select count(*) as goods_month from ". $ecs->table('goods') ." where last_update >= " . $time_month; //本月更新數(shù) $smarty->assign('goodsnum_month',$db->getOne($sql));
2)、打開首頁模板文件 index.dwt,在合適的地方調(diào)用,調(diào)用代碼 本商城共有商品 {$goodsnum_all} 件,本月更新 {$goodsnum_month} 件 |
|
|