dever 3 gadi atpakaļ
vecāks
revīzija
4b38293756
2 mainītis faili ar 62 papildinājumiem un 4 dzēšanām
  1. 16 4
      service/option/database/account.php
  2. 46 0
      service/option/lib/Account.php

+ 16 - 4
service/option/database/account.php

@@ -43,6 +43,8 @@ $is_idcard = array
 
 $col = Dever::input('col');
 
+$type = Dever::input('option_search_type');
+
 return array
 (
     # 表名
@@ -158,7 +160,7 @@ return array
             'match'     => 'is_numeric',
             'option'    => $is_idcard,
             //'update'    => 'radio',
-            'list'      => true,
+            'list'      => $type ? false : true,
             'list_order' => 3,
         ),
 
@@ -171,6 +173,9 @@ return array
             'match'     => Dever::rule('idcard'),
             'match'     => 'is_string',
             'update'    => 'text',
+            'list'      => $type ? 'Dever::load("option/lib/account.getCash#daijiaofu", {id})' : false,
+            'list_name' => '待交付',
+            'list_order' => 4,
         ),
 
         'idcard_front'     => array
@@ -183,6 +188,9 @@ return array
             //'update'    => 'image',
             'key'       => '8',
             //'place'     => '660*660',
+            'list'      => $type ? 'Dever::load("option/lib/account.getCash#qiquan", {id})' : false,
+            'list_name' => '期权',
+            'list_order' => 5,
         ),
 
         'idcard_back'     => array
@@ -195,6 +203,9 @@ return array
             //'update'    => 'image',
             'key'       => '8',
             //'place'     => '660*660',
+            'list'      => $type ? 'Dever::load("option/lib/account.getCash#yuanshiqiquan", {id})' : false,
+            'list_name' => '原始期权',
+            'list_order' => 6,
         ),
 
         'sign'     => array
@@ -211,7 +222,7 @@ return array
         'audit'        => array
         (
             'type'      => 'tinyint-1',
-            'name'      => '审核状况',
+            'name'      => $type ? '账户认证' : '审核状况',
             'default'   => $col ? '3' : '1',
             'desc'      => '审核状况',
             'match'     => 'is_numeric',
@@ -219,7 +230,7 @@ return array
             'search'    => 'select',
             'update'    => $col ? 'radio' : false,
             'list'      => 'Dever::load("option/lib/account.getAudit", {id})',
-            'list_order' => 5,
+            'list_order' => $type ? 3 : 5,
             'value'     => $col ? '3' : '1',
             'control'   => 'audit',
         ),
@@ -252,7 +263,8 @@ return array
             'match'     => 'is_numeric',
             'option'    => $status,
             //'search'    => 'select',
-            //'list'      => true,
+            'list'      => $type ? true : false,
+            'list_order' => 100,
         ),
 
         'state'     => array

+ 46 - 0
service/option/lib/Account.php

@@ -267,4 +267,50 @@ class Account
 
         return 'reload';
     }
+
+    public function daijiaofu($id)
+    {
+        $where['aid'] = $id;
+        $total = Dever::db('option/bill_jiaofu')->total($where);
+        $html = $total . '条';
+        $cash = Dever::db('option/cash')->select(array('aid' => $id));
+        $total = 0;
+        if ($cash) {
+            foreach ($cash as $k => $v) {
+                $total += $v['daijiaofu'];
+            }
+        }
+        $html .= '<br/ >' . number_format($total, 2, '.', '');
+        return $html;
+    }
+
+    public function getCash($id)
+    {
+        $where['aid'] = $id;
+        $total = Dever::db('option/bill_jiaofu')->total($where);
+        $daijiaofu = $total . '条';
+        $cash = Dever::db('option/cash')->select(array('aid' => $id));
+        $total = 0;
+        $qiquan = '';
+        $yuanshiqiquan = '';
+        if ($cash) {
+            foreach ($cash as $k => $v) {
+                $v['total'] = number_format($v['jiaofu'] + $v['fafang'] + $v['duifu'], 2, '.', '');
+                $total += $v['daijiaofu'];
+                if ($v['type'] == 1) {
+                    $qiquan .= $v['total'];
+                    $qiquan .= '发放' . $v['fafang'];
+                    $qiquan .= '未发' . $v['jiaofu'];
+                    $qiquan .= '兑付' . $v['duifu'];
+                } elseif ($v['type'] == 2) {
+                    $yuanshiqiquan .= $v['total'];
+                    $yuanshiqiquan .= '发放' . $v['fafang'];
+                    $yuanshiqiquan .= '未发' . $v['jiaofu'];
+                    $yuanshiqiquan .= '兑付' . $v['duifu'];
+                }
+            }
+        }
+        $daijiaofu .= '<br/ >' . number_format($total, 2, '.', '');
+        return array('daijiaofu' => $daijiaofu, 'qiquan' => $qiquan, 'yuanshiqiquan' => $yuanshiqiquan);
+    }
 }