tangyuanwang 1 день назад
Родитель
Сommit
6496c8b9d7
1 измененных файлов с 8 добавлено и 5 удалено
  1. 8 5
      app/Http/Controllers/Manager/Statistics/BasicPanel.php

+ 8 - 5
app/Http/Controllers/Manager/Statistics/BasicPanel.php

@@ -92,18 +92,19 @@ class BasicPanel extends Controller
              $productModel_other_map[] = ['sampling_start_time', '>=', $start_time];
         }
         if ($end_time){
-             $productModel_map[]   = ['sampling_end_time', '<=', $end_time];
+             $productModel_map[]   = ['sampling_end_time', '>=', $end_time];
              $productModel_map[]   = ['sampling_end_time', '!=', '0'];
+             $productModel_other_map[] = ['sampling_end_time', '=', '0'];
         }
         if ($is_admin != 1 && $company_id != 0) {
             $productModel = $productModel->where('company_id', $company_id);
         } else {
             $productModel = $productModel->where('company_id', $admin_company_id);
         }
-
+        //B端:药师帮、1药城、药久久、药易购、药帮忙、熊猫药药 
         $productNames = $productModel
             ->where(function ($query) {
-                $platforms = ['0', '5', '6', '7', '8', '9', '10'];
+                $platforms = ['0', '5', '6', '7', '8', '9', '10'];//1=淘宝,2=京东,3=拼多多,4=美团,5=药师帮,6=1药城,7=药久久,8=药易购,9=药帮忙,10=熊猫药药11=药房网
                 foreach ($platforms as $platform) {
                     $query->orWhereRaw("FIND_IN_SET(?, platform)", [$platform]);
                 }
@@ -132,8 +133,9 @@ class BasicPanel extends Controller
              $productModel_other_map[] = ['sampling_start_time', '>=', $start_time];
         }
         if ($end_time){
-             $productModel_map[]   = ['sampling_end_time', '<=', $end_time];
+             $productModel_map[]   = ['sampling_end_time', '>=', $end_time];
              $productModel_map[]   = ['sampling_end_time', '!=', '0'];
+             $productModel_other_map[] = ['sampling_end_time', '=', '0'];
         }
         if ($is_admin != 1 && $company_id != 0) {
             $productModel = $productModel->where('company_id', $company_id);
@@ -173,8 +175,9 @@ class BasicPanel extends Controller
              $productModel_other_map[] = ['sampling_start_time', '>=', $start_time];
         }
         if ($end_time){
-             $productModel_map[]   = ['sampling_end_time', '<=', $end_time];
+             $productModel_map[]   = ['sampling_end_time', '>=', $end_time];
              $productModel_map[]   = ['sampling_end_time', '!=', '0'];
+             $productModel_other_map[] = ['sampling_end_time', '=', '0'];
         }
         if ($is_admin != 1 && $company_id != 0) {
             $productModel = $productModel->where('company_id', $company_id);