Browse Source

股份分红记录-增加导出

sunxbiao 1 year ago
parent
commit
3dab2358da
1 changed files with 29 additions and 0 deletions
  1. 29 0
      app/controller/admin/user/User.php

+ 29 - 0
app/controller/admin/user/User.php

@@ -1694,6 +1694,35 @@ class User extends BaseController
1694
             ->field('o.*,u.uid,u.real_name,u.nickname,u.account')
1694
             ->field('o.*,u.uid,u.real_name,u.nickname,u.account')
1695
             ->where($where);
1695
             ->where($where);
1696
 
1696
 
1697
+        // 导出
1698
+        $is_excel = request()->param('is_excel', 0);
1699
+        if ($is_excel == 1) {
1700
+            $data = $query->select();
1701
+            $arr = [];
1702
+            foreach ($data as $item) {
1703
+                $arr[] = [
1704
+                    $item['id'],
1705
+                    $item['nickname'],
1706
+                    $item['account'],
1707
+                    $item['pack'],
1708
+                    $item['getcomm'],
1709
+                    $item['allgetcomm'],
1710
+                    $item['create_time'],
1711
+                    $item['update_time']
1712
+                ];
1713
+            }
1714
+            return app('json')->success($this->getStatisticsExcel([
1715
+                'ID',
1716
+                '用户昵称',
1717
+                '用户账号(手机号)',
1718
+                '份数',
1719
+                '本次佣金',
1720
+                '累计佣金',
1721
+                '创建时间',
1722
+                '更新时间'
1723
+            ], $arr, '股权分红明细'));
1724
+        }
1725
+
1697
         $query1 = clone($query);
1726
         $query1 = clone($query);
1698
         $stock_getcomm = $query1->sum('getcomm');
1727
         $stock_getcomm = $query1->sum('getcomm');
1699
         $stock_allgetcomm = $query1->sum('allgetcomm');
1728
         $stock_allgetcomm = $query1->sum('allgetcomm');