Your Name 3 anos atrás
pai
commit
6e41b74f91

+ 8 - 8
service/mail/assets/pc/html/qiquan.html

@@ -33,7 +33,7 @@ th {
 <body>
 <div class="layui-container">
 <div class="layui-card">
-  <blockquote class="layui-elem-quote"><a href="javascript:;" class="layui-btn" id="excel">数据导出</a></blockquote>
+  <!-- <blockquote class="layui-elem-quote"><a href="javascript:;" class="layui-btn" id="excel">数据导出</a></blockquote> -->
   <div class="layui-card-body">
       <h3>账户情况:</h3>
      
@@ -100,13 +100,13 @@ th {
 
 </div>
 <script>
-function excel()
-{
-  location.href = config.host + 'lib/manage.out_option_qiquan';
-}
-$('#excel').click(function() {
-  excel();
-})
+// function excel()
+// {
+//   location.href = config.host + 'lib/manage.out_option_qiquan';
+// }
+// $('#excel').click(function() {
+//   excel();
+// })
 </script>
 </body>
 </html>

+ 49 - 40
service/mail/lib/Manage.php

@@ -575,56 +575,65 @@ class Manage
         $data['total_price'] = $data['a_price'] + $data['a_noprice'];
         return Dever::render('soft_cash', $data);
     }
-    public function out_option_qiquan_api()
+    public function out_option_qiquan_api($data)
     {
-        $header = array('账户名称', '账户类型', '手机号', '索引','待交付', '已交付', '发放',  '兑付');
-        $data = Dever::db('option/member')->state();
+        // print_R($data);die;
+        $header = array('索引', '账户名称', '账户类型', '手机号','待交付', '已交付', '发放',  '兑付');
+        // $data = Dever::db('option/member')->state();
         $body = array();
         $main = '';
         $f_money = 0;
         $j_money = 0;
         $dj_money = 0;
         $d_money = 0;
-        foreach ($data as $k => $v) {
-            if ($v['main'] == 1) {
-                $main = '主账户';
-            } else {
-                $main = '子账户';
-            }
-            $where['aid'] = $v['id'];
-            $ff = Dever::db('option/bill_fafang')->getSearch($where);
-            if ($ff && $ff['total']) {
-                $f_money = $ff['total'];
-            }
-            $where['status'] = 1;
-            $jiaofu = Dever::db('option/bill_jiaofu')->getSearch($where);
-            if ($jiaofu && $jiaofu['total']){
-                $j_money = $jiaofu['total'];
-            }
-            $where['status'] = 2;
-            $jiaofu = Dever::db('option/bill_jiaofu')->getSearch($where);
-            if ($jiaofu && $jiaofu['total']){
-                $dj_money = $jiaofu['total'];
-            }
-            $duifu = Dever::db('option/bill_duifu')->getSearch($where);
-            if ($duifu && $duifu['total']){
-                $d_money = $duifu['total'];
+        foreach ($data as $k1 => $v1) {
+            $member[] = Dever::db('option/member')->select(array('aid' => $v1['id']));
+
+        }
+        foreach ($member as $k => $v1) {
+            foreach ($v1 as $v) {
+                if ($v['main'] == 1) {
+                    $main = '主账户';
+                } else {
+                    $main = '子账户';
+                }
+                $where['aid'] = $v['id'];
+                $ff = Dever::db('option/bill_fafang')->getSearch($where);
+                if ($ff && $ff['total']) {
+                    $f_money = $ff['total'];
+                }
+                $where['status'] = 1;
+                $jiaofu = Dever::db('option/bill_jiaofu')->getSearch($where);
+                if ($jiaofu && $jiaofu['total']){
+                    $j_money = $jiaofu['total'];
+                }
+                $where['status'] = 2;
+                $jiaofu = Dever::db('option/bill_jiaofu')->getSearch($where);
+                if ($jiaofu && $jiaofu['total']){
+                    $dj_money = $jiaofu['total'];
+                }
+                $duifu = Dever::db('option/bill_duifu')->getSearch($where);
+                if ($duifu && $duifu['total']){
+                    $d_money = $duifu['total'];
+                }
+                $d =array
+                (
+                    $v['key'],
+                    $v['name'],
+                    $main,
+                    $v['mobile'],
+                    
+                    $dj_money,
+                    $j_money,
+                    $f_money,
+                    $d_money,
+                );
+                $body[] = $d;
             }
-            $d =array
-            (
-                $v['name'],
-                $main,
-                $v['mobile'],
-                $v['key'],
-                $dj_money,
-                $j_money,
-                $f_money,
-                $d_money,
-            );
-            $body[] = $d;
+            
         }
         $file = '期权导出';
-        Dever::excelExport($body, $header, $file);
+        return Dever::excelExport($body, $header, $file);
     }
 
     #采购价-成本价

+ 5 - 1
service/option/database/account.php

@@ -84,7 +84,10 @@ if ($search_auth == 1) {
 } elseif ($search_auth == 3) {
     $list_button['list1'] = array('账户列表', '"member&search_option_aid={id}&search_option_dever_auth='.$search_auth.'"');
 }
-
+$excel = false;
+if(Dever::load('manage/auth')->checkFunc('option.account', 'editCardMout', '数据导出')){
+    $excel[] = array('数据导出','数据导出', 'mail/lib/manage.out_option_qiquan');
+}
 // if (Dever::load('manage/auth')->checkFunc('menu_279.menu_290','setmessage','发送短信')) {
 //         $list_button['fast'] = array('发送短信','Dever::load("option/lib/account.send_sms",{mid})');
 // }
@@ -422,6 +425,7 @@ return array
         'edit' => false,
         'button' => $button,
         'list_button' => $list_button,
+        'excel' => $excel,
     ),
 
     'request' => array