🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
#### 1.视图展示 文件路径:\shop\views\default\Seller\IndexCtl\index.php ~~~ <div class="m white-panel"> <div class="pannel_div"> <div class="mt"> <h3 class="bbc_seller_border"><?=__('销售情况统计')?></h3> <h5><?=__('按周期统计商家店铺的订单量和订单金额')?></h5> </div> <div class="mc"> <table width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="20%"></td> <td width="40%"><?=__('订单量')?></td> <td width="40%"><?=__('订单金额')?></td> </tr> <tr> <td><?=__('今日销量')?></td> <td><?=@$today['sales_num']?></td> <td><?=@format_money($today['order_sales'])?></td> </tr> <tr> <td><?=__('周销量')?></td> <td><?=@$week['sales_num']?></td> <td><?=@format_money($week['order_sales'])?></td> </tr> <tr> <td><?=__('月销量')?></td> <td><?=@$month['sales_num']?></td> <td><?=@format_money($month['order_sales'])?></td> </tr> </table> </div> </div> </div> ~~~ #### 2.数据获取 接口地址:index.php?ctl=Seller_Index&met=index&typ=e 接口文件:\shop\controllers\Seller\IndexCtl.php 控制器:Seller_IndexCtl 方法:index() ~~~ //销量统计 $start_date = date("Y-m-d", strtotime("-30 days")); $start_today_date = date("Y-m-d"); $start_yes_date = date("Y-m-d", strtotime("-1 days")); $start_week_date = date("Y-m-d", strtotime("-7 days")); $today = $this->shopBaseModel->getShopSales(Perm::$shopId,$start_today_date); $week = $this->shopBaseModel->getShopSales(Perm::$shopId,$start_week_date); $month = $this->shopBaseModel->getShopSales(Perm::$shopId,$start_date); ~~~