rabin 3 år sedan
förälder
incheckning
2fa2dd7cfd
2 ändrade filer med 26 tillägg och 2 borttagningar
  1. 1 1
      app/card/database/code.php
  2. 25 1
      app/card/src/Api.php

+ 1 - 1
app/card/database/code.php

@@ -276,7 +276,7 @@ return array
                 'state' => 1,
             ),
             'type' => 'all',
-            'page' => array(10, 'list'),
+            'page' => array(100, 'list'),
             'order' => array('total_cash`-`use_cash' => 'desc', 'ddate' => 'desc'),
             'col' => '*',
         ),

+ 25 - 1
app/card/src/Api.php

@@ -235,11 +235,25 @@ class Api extends Core
                 $city = $county['city_id'];
             }
         }
-
+        $time = time();
         if ($this->data['card']) {
             foreach ($this->data['card'] as $k => $v) {
                 $v['info'] = $this->data['card'][$k]['info'] = Dever::db('card/info')->find($v['card_id']);
 
+                if (!$v['info']) {
+                    continue;
+                }
+
+                if ($v['info']['end_dh_day'] && $v['info']['end_dh_day'] > 0) {
+                    $v['eddate'] = $v['bdate'] + ($v['info']['end_dh_day'] * 86400);
+                }
+
+                if (isset($v['eddate']) && $v['eddate'] && $v['eddate'] > 0) {
+                    if ($v['eddate'] <= $time) {
+                        continue;
+                    }
+                }
+
                 if (!$v['total_cash']) {
                     $v['total_cash'] = $v['info']['value'];
                 }
@@ -339,11 +353,21 @@ class Api extends Core
         $this->data['card'] = array();
         $this->data['no_card'] = array();
         if ($card) {
+            $time = time();
             foreach ($card as $k => $v) {
                 $v['info'] = Dever::db('card/info')->find($v['card_id']);
                 if (!$v['info']) {
                     continue;
                 }
+                if ($v['info']['end_dh_day'] && $v['info']['end_dh_day'] > 0) {
+                    $v['eddate'] = $v['bdate'] + ($v['info']['end_dh_day'] * 86400);
+                }
+
+                if (isset($v['eddate']) && $v['eddate'] && $v['eddate'] > 0) {
+                    if ($v['eddate'] <= $time) {
+                        continue;
+                    }
+                }
                 if (!$v['total_cash']) {
                     $v['total_cash'] = $v['info']['value'];
                 }