极致CMS后台制作财务统计信息模块

Fiime社区-奥奥 · 1654次点击 · 2022-09-30
<div class="layui-col-md5">
    <div class="layui-card">
        <div class="layui-card-header">财务信息</div>
        <div class="layui-card-body layui-text">
          <table class="layui-table">
            <colgroup>
              <col width="100">
              <col>
            </colgroup>
            <tbody>
              <tr>
              {php   
                    $beginToday=mktime(0,0,0,date('m'),date('d'),date('Y'));
                    $endToday=mktime(0,0,0,date('m'),date('d')+1,date('Y'))-1;
                    $sql="addtime >=".$beginToday." and addtime<".$endToday." and ispay=1 ";
                    $Todaynum= M('orders')->getCount($sql);
                /}
                <td>已支付</td><td>{loop table="orders" limit="1" ispage="1" as="random"}共计:  {$random_sum}个{/loop}</td>
                <td>今日订单</td><td>{$Todaynum} 个</td>
              </tr>
              <tr>
                {php   
                    $sql="ispay=1 and paytype!='积分兑换'";
                    $spp=M('orders')->findAll($sql);
                    $pPricenum=array_sum(array_column($spp,'price'));
                /}
                {php   
                    $beginToday=mktime(0,0,0,date('m'),date('d')-30,date('Y'));
                    $endToday=mktime(0,0,0,date('m'),date('d'),date('Y'))-1;
                    $sql="addtime >=".$beginToday." and addtime<".$endToday." and ispay=1 and paytype!='积分兑换'";
                    $spp=M('orders')->findAll($sql);
                    $Pricenum=array_sum(array_column($spp,'price'));
                /}
                <td>总收入</td><td>{$pPricenum} 元</td>
                <td>30天收入</td><td>{$Pricenum} 元</td>
              </tr>
              <tr>
                {php
                    $sql="ispay=1 and paytype='积分兑换'";
                    $spp=M('orders')->findAll($sql);
                    $Pricenum=array_sum(array_column($spp,'jifen'));
                /}
                {php   
                    $beginToday=mktime(0,0,0,date('m'),date('d'),date('Y'));
                    $endToday=mktime(0,0,0,date('m'),date('d')+1,date('Y'))-1;
                    $sql="addtime >=".$beginToday." and addtime<".$endToday." and ispay=1 and paytype='积分兑换'";
                    $spp=M('orders')->findAll($sql);
                    $Pricenum1=array_sum(array_column($spp,'jifen'));
                /}
                <td>共计兑换</td><td>{$Pricenum} 分</td>
                <td>今日兑换:</td><td>{$Pricenum1} 分</td>
               </td>
              </tr>
                <td>今日收入</td>
                <td>
                    {php   
                        $beginToday=mktime(0,0,0,date('m'),date('d'),date('Y'));
                        $endToday=mktime(0,0,0,date('m'),date('d')+1,date('Y'))-1;
                        $sql="addtime >=".$beginToday." and addtime<".$endToday." and ispay=1 and paytype!='积分兑换'";
                        $spp=M('orders')->findAll($sql);
                        $Pricenum=array_sum(array_column($spp,'price'));
                    /}
                    {$Pricenum} 元
                    
                    {php   
                        $beginToday=mktime(0,0,0,date('m'),date('d')-1,date('Y'));
                        $endToday=mktime(0,0,0,date('m'),date('d'),date('Y'))-1;
                        $sql="addtime >=".$beginToday." and addtime<".$endToday." and ispay=1 and paytype!='积分兑换'";
                        $spp=M('orders')->findAll($sql);
                        $Pricenum=array_sum(array_column($spp,'price'));
                    /}
                    <td>昨日收入</td><td>{$Pricenum} 元</td>
               </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    {if($isadmin)}
    <div class="layui-card">
        <div class="layui-card-header">今日最新订单(已支付)</div>
        <div class="layui-card-body">
          <ul class="layuiadmin-card-status layuiadmin-home2-usernote">
          {loop table="orders" limit="20" orderby="addtime desc" as="vvv"}
          {if(date('Y-m-d',$vvv['addtime'])==date('Y-m-d',time()))}
            {if($vvv[ispay]==1)}
            <li>
              <h3>订单号:{$vvv['orderno']}</h3>
              <p>用户:{$vvv[username]}({$vvv['userid']})
              <br>
              From:{$vvv[paytype]}
              <br>
              {php $body = explode('||',$vvv['body'])/}
              {php                  
                $new = [];
                foreach($body as $v){
                    if($v!=''){
                        $d = explode('-',$v);
                        //兼容历史订单,可能出现栏目被删除的情况,防止报错
                        if(isset($classtypedata[$d[0]])){
                            $type = $classtypedata[$d[0]];//栏目
                            $new[]=['info'=>M($type['molds'])->find(['id'=>$d[1]]),'num'=>$d[2],'price'=>$d[3],'tid'=>$d[0]];
                        }else{
                            $new[]=['info'=>false,'num'=>$d[2],'price'=>$d[3],'tid'=>$d[0]];
                        }
                    }
                }
                /}
                {foreach $new as $ss}
                {if($ss['info'])}
                    所属机型:{$ss['info']['title']}
                {else if($ss['info'])}
                    {if($ss['info']['title'] == "")}
                        积分充值
                    {else}
                        其他
                    {/if}
                {else}
                    [商品已删除]
                {/if}
                {/foreach}
              <br>
              {if($vvv[paytype]=='积分兑换')}
              积分:{$vvv['jifen']} 分
              {else}
              金额:{$vvv['price']} 元
              {/if}
              </p>
              <span>{fun formatTime($vvv['addtime'],'Y-m-d H:i:s')}</span>
              <a href="{fun U('Order/details',['id'=>$vvv['id']])}"  class="layui-btn layui-btn-xs layuiadmin-reply">查看订单</a>
            </li>
            {else}
            {/if}
          {else}
          {/if}  
          {/loop}
           
        </ul>
    </div>
</div>

直接上代码,不喜欢墨迹,大家喜欢就可以拿走,支持极致,希望大家可以玩出更过可能!

修改的路径是/www/wwwroot/mi.fiime.cn/A/t/tpl/wellcome.html


效果:

image.png

建议备份哦,然后再改!


码字不易,感谢支持!

被收藏 0  ∙  2 赞  
加入收藏
2 回复  
善言善语 (您需要 登录 后才能回复 没有账号 ?)

请先登录网站