Your Name 3 years ago
parent
commit
c042ac1016

+ 9 - 2
service/mail/assets/pc/html/qiquan.html

@@ -13,7 +13,7 @@
 <script src="../script/lib/jquery/jquery.min.js"></script>
 <script src="../script/lib/layui/layui.js"></script>
 <script src="../script/lib/echarts/echarts.common.min.js"></script>
-<script><{Dever::script()}></script>
+<script><{echo Dever::script()}></script>
 <script src="../script/dever/core.js"></script>
 <style>
 .dever-upload-pic
@@ -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>
   <div class="layui-card-body">
       <h3>账户情况:</h3>
      
@@ -100,6 +100,13 @@ th {
 
 </div>
 <script>
+function excel()
+{
+  location.href = config.host + 'lib/manage.out_option_qiquan';
+}
+$('#excel').click(function() {
+  excel();
+})
 </script>
 </body>
 </html>

+ 52 - 0
service/mail/lib/Manage.php

@@ -575,6 +575,58 @@ class Manage
         $data['total_price'] = $data['a_price'] + $data['a_noprice'];
         return Dever::render('soft_cash', $data);
     }
+    public function out_option_qiquan_api()
+    {
+        $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'];
+            }
+            $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);
+    }
+
     #采购价-成本价
     public function caigou($where){
         $data = Dever::db('shop/buy_order')->getNewAll($where);

+ 13 - 0
service/option/database/bill_duifu.php

@@ -289,5 +289,18 @@ return array
             'type' => 'all',
             'col' => '*',
         ),
+
+        'getSearch' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'aid' => 'yes',
+                'status' => 2,
+                'state' => 1,
+            ),
+            'type' => 'one',
+            'col' => 'sum(cash) as total',
+        ),
     ),
 );

+ 13 - 0
service/option/database/bill_fafang.php

@@ -302,5 +302,18 @@ return array
             'type' => 'one',
             'col' => 'sum(cash) as total',
         ),
+
+        'getSearch' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'aid' => 'yes',
+                'status' => 2,
+                'state' => 1,
+            ),
+            'type' => 'one',
+            'col' => 'sum(cash) as total',
+        ),
     ),
 );

+ 13 - 0
service/option/database/bill_jiaofu.php

@@ -377,5 +377,18 @@ return array
             'type' => 'one',
             'col' => 'sum(cash) as total',
         ),
+
+        'getSearch' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'aid' => 'yes',
+                'status' => 'yes',
+                'state' => 1,
+            ),
+            'type' => 'one',
+            'col' => 'sum(cash) as total',
+        ),
     ),
 );