stanley-king 2 年之前
父节点
当前提交
a687fd7f7c
共有 1 个文件被更改,包括 12 次插入17 次删除
  1. 12 17
      helper/statistics/refill_balance.php

+ 12 - 17
helper/statistics/refill_balance.php

@@ -136,19 +136,19 @@ class refill_balance
             $item = $mod_refill->table('refill_order')->field('order_id,order_time')
                 ->where(['order_time' => ['lt', $end]])
                 ->order('order_id asc')->find();
-            $time = $item['order_time'] ?? 0;
+            $time = $item['order_time'] ?? $end;
         } elseif ($type == 'merchant') {
             $mod_refill = Model('refill_order');
             $item = $mod_refill->table('refill_order')->field('order_id,order_time')
                 ->where(['mchid' => $cid, 'order_time' => ['lt', $end]])
                 ->order('order_id asc')->find();
-            $time = $item['order_time'] ?? 0;
+            $time = $item['order_time'] ?? $end;
         } else {
             $mod_refill = Model('vr_order');
             $item = $mod_refill->table('vr_order')->field('order_id,add_time')
                 ->where(['store_id' => $cid,'add_time' => ['lt', $end]])
                 ->order('order_id asc')->find();
-            $time = $item['order_time'] ?? 0;
+            $time = $item['add_time'] ?? $end;
         }
 
         return $time;
@@ -176,7 +176,7 @@ class refill_balance
                 ->find();
         }
 
-        $time = $item['madd_time'] ?? 0;
+        $time = $item['madd_time'] ?? $end;
         return $time;
     }
 
@@ -202,7 +202,7 @@ class refill_balance
                 ->find();
         }
 
-        $time = $item['madd_time'] ?? 0;
+        $time = $item['madd_time'] ?? $end;
         return $time;
     }
 
@@ -256,19 +256,14 @@ class refill_balance
             $balance = ncPriceFormat($in - $order_stat['channel_amounts']);
         }
 
-        if($start == 0)
-        {
-            $time = min($refill_time,$pay_time);
-            if($time == 0) {
-                return [];
-            }
-
-            $start = strtotime(date('Y-m-d', $time));
-        }
-
-        if($start === $end) {
-            return [];
+        if ($start == 0) {
+            $time = min($refill_time, $pay_time);
+            $start = strtotime(date('Y-m-d', $time - 1));
         }
+        //
+//        if($start === $end) {
+//            return [];
+//        }
 
         $accumuter = function ($parent_id)
         {