shish 2 лет назад
Родитель
Сommit
c7dbbab298
1 измененных файлов с 8 добавлено и 0 удалено
  1. 8 0
      app-ghs/controllers/CustomController.php

+ 8 - 0
app-ghs/controllers/CustomController.php

@@ -568,6 +568,14 @@ class CustomController extends BaseController
             $sort = '(debtAmount-balance) DESC';
         } else if ($type == 3) {
             $where['level'] = 0;
+        } else if ($type == 4) {
+            //最近消费时间
+            $recentDay = isset($get['recentDay']) && is_numeric($get['recentDay']) ? (int)$get['recentDay'] : 7;
+            $totalSecond = bcmul(86400, $recentDay);
+            $currentSecond = bcsub(time(), $totalSecond);
+            $currentDate = date("Y-m-d H:i:s", $currentSecond);
+            $where['recentExpend<'] = $currentDate;
+            $sort = 'recentExpend asc';
         }
         $name = trim($name);
         if (!empty($name)) {