Browse Source

平台列表细节优化

wufeng 2 years ago
parent
commit
4059b956ee
1 changed files with 14 additions and 11 deletions
  1. 14 11
      app/admin/controller/Platform.php

+ 14 - 11
app/admin/controller/Platform.php

@@ -142,13 +142,14 @@ class Platform extends Base
             'page' => 1,
             'size' => 10,
             'platform_name' => '',
-            'platform_type' => '',
-            'use_type' => '',
+//            'platform_type' => '',
+//            'use_type' => '',
             'status' => '',
             'start' => '',
             'end' => '',
-            'is_show' => 1,
-            'company_name' => '',
+//            'is_show' => 1,
+            'creater' => ''
+//            'company_name' => '',
         ], 'post', 'trim');
 
 //        $page = isset($this->post['page']) && $this->post['page']!=="" ? intval($this->post['page']):"1";
@@ -158,10 +159,10 @@ class Platform extends Base
         if ($param['platform_name'] != "") $where[] = ['p.platform_name', "like", '%' . $param['platform_name'] . '%'];
 
 //        $platform_type = isset($this->post['platform_type']) && $this->post['platform_type'] !=="" ? intval($this->post['platform_type']):"";
-        if ($param['platform_type'] !== "") $where[] = ['p.platform_type', "=", $param['platform_type']];
+//        if ($param['platform_type'] !== "") $where[] = ['p.platform_type', "=", $param['platform_type']];
 
 //         $use_type = isset($this->post['use_type']) && $this->post['use_type'] !=="" ? intval($this->post['use_type']):"";
-        if ($param['use_type'] !== "") $where[] = ['p.use_type', "=", $param['use_type']];
+//        if ($param['use_type'] !== "") $where[] = ['p.use_type', "=", $param['use_type']];
 
 //        $status = isset($this->post['status']) && $this->post['status'] !=="" ? intval($this->post['status']) :"";
         if ($param['status'] !== "") $where[] = ['p.status', "=", $param['status']];
@@ -178,7 +179,8 @@ class Platform extends Base
             if (!empty($role['platform'])) $where[] = ["p.id", "in", $role['platform']];
         }
 //        $company_name = isset($this->post['company_name']) && $this->post['company_name'] !== "" ? trim($this->post['company_name']) : "";
-        if ($param['company_name'] !== "") $where[] = ["p.createrid", 'in', get_company_item_user_by_name($param['company_name'])];
+//        if ($param['company_name'] !== "") $where[] = ["p.createrid", 'in', get_company_item_user_by_name($param['company_name'])];
+        if($param['creater'] != '') $where[]=['p.creater','like','%'.$param['creater'].'%'];
 
         $count = Db::name('platform')
             ->alias('p')
@@ -204,10 +206,10 @@ class Platform extends Base
 
         foreach ($list as &$value) {
             $value['company_name'] = $company[$value['createrid']] ?? '';
-            $value['pay_list'] = Db::name('platform_pay_rate')
-                ->where(['platform_id' => $value['id'], 'is_del' => 0])
-                ->select()
-                ->toArray();
+//            $value['pay_list'] = Db::name('platform_pay_rate')
+//                ->where(['platform_id' => $value['id'], 'is_del' => 0])
+//                ->select()
+//                ->toArray();
         }
 
         return app_show(0, "获取成功", ['list' => $list, 'count' => $count]);
@@ -394,6 +396,7 @@ class Platform extends Base
         if (empty($info)) return error_show(1004, '未找到数据');
         else {
             $info['pay_list'] = Db::name('platform_pay_rate')
+                ->field('id,companyNo,rate,status')
                 ->where(['platform_id' => $info['id'], 'is_del' => 0])
                 ->select()
                 ->toArray();