Эх сурвалжийг харах

调整客户统计检索和显示项

yb 1 сар өмнө
parent
commit
b85eace537

+ 8 - 0
app/admin/service/consultant/CustomService.php

@@ -123,6 +123,14 @@ class CustomService
                 $query->whereBetween('created_at', $createdDate);
             }];
         }
+        if (!empty($params['check_date'])) {
+            $checkDate = $params['check_date'];
+            $checkDate[0] = strtotime($checkDate[0].' 00:00:00');
+            $checkDate[1] = strtotime($checkDate[1].' 23:59:59');
+            $where[] = [function($query) use ($checkDate) {
+                $query->whereBetween('check_time', $checkDate)->where('current_status', '>', 1);
+            }];
+        }
 
         if (!empty($params['current_status'])) {
             $currentStatus = $params['current_status'];

+ 7 - 0
app/model/MarketCustomer.php

@@ -28,6 +28,13 @@ class MarketCustomer extends Model
         });
     }
 
+    protected function checkTime():Attribute
+    {
+        return Attribute::get(function ($value) {
+            return date('Y-m-d H:i:s', $value);
+        });
+    }
+
     public static function config()
     {
         $config = [