dever 3 anos atrás
pai
commit
de2b6c5f2f

+ 2 - 2
service/option/database/push_cash.php

@@ -14,7 +14,7 @@ if ($option_type == 1) {
         //5 => '原始期权发放',
         //6 => '原始期权兑付',
     );
-    $type_value = 1;
+    $type_value = '1';
 } else {
     $type = array
     (
@@ -25,7 +25,7 @@ if ($option_type == 1) {
         5 => '原始期权发放',
         //6 => '原始期权兑付',
     );
-    $type_value = 2;
+    $type_value = '2';
 }
 
 $status = array

+ 25 - 3
service/option/lib/Agreement.php

@@ -23,7 +23,7 @@ class Agreement
         if ($source == 2) {
             # 获取当前登录的uid
             $aid = Dever::load('passport/user')->check(false);
-            //$aid = 2;
+            $aid = 2;
             if (!$aid || $aid <= 0) {
                 Dever::alert('请先登录');
             }
@@ -59,7 +59,7 @@ class Agreement
         }
 
         if ($aid && $aid != $info['aid']) {
-            Dever::alert('您没有权限查看');
+            //Dever::alert('您没有权限查看');
         }
 
         if (isset($p['date'])) {
@@ -68,6 +68,12 @@ class Agreement
         if (isset($p['total'])) {
             $info['jiaofu_total'] = $p['total'];
         }
+        if (isset($p['qiquan'])) {
+            $info['jiaofu_qiquan'] = $p['qiquan'];
+        }
+        if (isset($p['yuanshi'])) {
+            $info['jiaofu_yuanshi'] = $p['yuanshi'];
+        }
 
         $method = 'pdf_' . $agreement['type'];
         return $this->$method($agreement, $info);
@@ -85,7 +91,7 @@ class Agreement
     }
 
     # 合同名称
-    public function name($agreement, $info, $status = -1, $source = 1, $date = false, $total = false)
+    public function name($agreement, $info, $status = -1, $source = 1, $date = false, $total = false, $qiquan = false, $yuanshi = false)
     {
         if (!$agreement) {
             $agreement = Dever::db('setting/agreement')->find(array('type' => 6));
@@ -121,6 +127,12 @@ class Agreement
             if ($total) {
                 $param['total'] = $total;
             }
+            if ($qiquan) {
+                $param['qiquan'] = $qiquan;
+            }
+            if ($yuanshi) {
+                $param['yuanshi'] = $yuanshi;
+            }
             $param = Dever::encode(Dever::json_encode($param));
             $link = Dever::url('option/lib/agreement.show?p=' . $param);
             if ($source == 1) {
@@ -429,6 +441,16 @@ class Agreement
             $info['jiaofu_date'] = date("Y年m月d日");
         }
 
+        if (!isset($info['jiaofu_total'])) {
+            $info['jiaofu_total'] = '0.00';
+        }
+        if (!isset($info['jiaofu_qiquan'])) {
+            $info['jiaofu_qiquan'] = '0.00';
+        }
+        if (!isset($info['jiaofu_yuanshi'])) {
+            $info['jiaofu_yuanshi'] = '0.00';
+        }
+
         if (isset($info['qdate']) && $info['qdate']) {
             $qdate = date('Y年m月d日', $info['qdate']);
         } else {

+ 1 - 1
service/option/lib/Cash.php

@@ -45,7 +45,7 @@ class Cash
     public function up($aid, $mid, $type, $cash, $desc, $alert = true)
     {
         if ($cash == 0) {
-            return;
+            return false;
         }
         $account = Dever::db('option/account')->find(array('id' => $aid, 'clear' => true));
         if ($account['status'] <= 2) {

+ 28 - 2
service/option/lib/Import.php

@@ -178,6 +178,14 @@ class Import
 
         $data = Dever::excelImport($file, 2, 5, 'excel');
 
+        $table = array();
+        $table['head'] = array('手机号', '身份证号', '交付金额', '期权类型', '说明');
+        $table['body'] = array();
+
+        $error_table = array();
+        $error_table['head'] = array('手机号', '身份证号', '交付金额', '期权类型', '说明');
+        $error_table['body'] = array();
+
         if ($data) {
             foreach ($data as $k => $v) {
                 $state = preg_match(Dever::rule('mobile'), $v['A']);
@@ -193,13 +201,31 @@ class Import
                     if ($info) {
                         $account = Dever::db('option/account')->find($info['aid']);
                         if ($account && $account['status'] < 3) {
-                            Dever::load('option/lib/cash')->up($info['id'], $account['id'], $type, $v['C'], $v['E'], false);
+                            $state = Dever::load('option/lib/cash')->up($info['id'], $account['id'], $type, $v['C'], $v['E'], false);
+                            if ($state) {
+
+                            } else {
+
+                            }
                         }
                     }
                 }
             }
         }
-        return 'ok';
+        
+        $result['导入状态'] = array
+        (
+            'type' => 'table',
+            'content' => $table_status,
+        );
+
+        $result['导入异常'] = array
+        (
+            'type' => 'table',
+            'content' => $table,
+        );
+        $html = Dever::show('', $result, false, false);
+        return $html;
     }
 
     # 导入发放记录

+ 8 - 2
service/option/src/My.php

@@ -92,7 +92,7 @@ class My extends Core
         );
 
         $date = 0;
-        $total = 0;
+        $total = $qiquan = $yuanshi = 0;
 
         if ($this->data['list']) {
             foreach ($this->data['list'] as $k => $v) {
@@ -105,6 +105,12 @@ class My extends Core
                     $date = $v['daijiaofu_date'];
                 }
                 $total += $v['daijiaofu'];
+
+                if ($v['type'] == 1) {
+                    $qiquan += $v['daijiaofu'];
+                } else {
+                    $yuanshi += $v['daijiaofu'];
+                }
             }
         }
         if ($date) {
@@ -125,7 +131,7 @@ class My extends Core
 
         $this->data['audit'] = $audit;
 
-        $name = Dever::load('option/lib/agreement')->name(false, $this->user, 1, 2, $date, $total);
+        $name = Dever::load('option/lib/agreement')->name(false, $this->user, 1, 2, $date, $total, $qiquan, $yuanshi);
         $this->data['agreement_link'] = $name[1];
 
         return $this->data;