xiaoyu 2 years ago
parent
commit
c7c944da2b
1 changed files with 22 additions and 6 deletions
  1. 22 6
      admin/control/refill_analysis.php

+ 22 - 6
admin/control/refill_analysis.php

@@ -200,13 +200,21 @@ class refill_analysisControl extends SystemControl
     {
     {
         $cond = [];
         $cond = [];
         if(!empty($_GET['quality'])){
         if(!empty($_GET['quality'])){
-//            echo json_encode([]);
             $cond['qualitys'] = $_GET['quality'];
             $cond['qualitys'] = $_GET['quality'];
         }
         }
+        $url = $this->ANALYSIS_URL . 'plot/channels';
+        $resp = http_request($url);
+        preg_match_all('/[a-z]+_*[a-z]*/', $resp, $matches);
+        if(empty($resp) || empty($matches)) {
+            echo(json_encode(''));
+            return;
+        }
+        $cond['name'] = ['in', $matches[0]];
         $provider_list = $this->providers($cond);
         $provider_list = $this->providers($cond);
+
         $result = [];
         $result = [];
         foreach ($provider_list as $value) {
         foreach ($provider_list as $value) {
-            $data['name'] = $value['store_name'] ?? $value['name'];
+            $data['name'] = "{$value['store_name']}:{$value['name']}";
             $data['value'] = $value['name'];
             $data['value'] = $value['name'];
             $result[] = $data;
             $result[] = $data;
         }
         }
@@ -215,13 +223,21 @@ class refill_analysisControl extends SystemControl
 
 
     public function merchant_dataOp()
     public function merchant_dataOp()
     {
     {
-        $merchant_list = $this->merchants();
+        $cond = [];
+        $url = $this->ANALYSIS_URL . 'plot/mchids';
+        $resp = http_request($url);
+        preg_match_all('/\d{2,6}/', $resp, $matches);
+        if(empty($resp) || empty($matches)) {
+            echo(json_encode(''));
+            return;
+        }
+        $cond['mchid'] = ['in', $matches[0]];
+        $merchant_list = $this->merchants($cond);
+
         $result = [];
         $result = [];
         foreach ($merchant_list as $value) {
         foreach ($merchant_list as $value) {
-            $data['name'] = $value['company_name'] ?? $value['name'];
+            $data['name'] = $value['company_name'] ?? $value['name'] .':'. $value['mchid'];
             $data['value'] = $value['mchid'];
             $data['value'] = $value['mchid'];
-            $data['alpha'] = $value['alpha'];
-            $data['color'] = false;
             $result[] = $data;
             $result[] = $data;
         }
         }
         echo json_encode($result);
         echo json_encode($result);