ss 1 年之前
父节点
当前提交
4c3e35c1b5

+ 6 - 4
application/admin/controller/QualityTask.php

@@ -133,11 +133,13 @@ class QualityTask extends Auth
                     }
                     $buss = [];
                     if($v['type'] >0){
-                        if(in_array($v['type'],[1,2,3,4])){
+                        if(in_array($v['type'],[1,2,3,4,5])){
                             $table = 'address';
-                        }else if($v['type'] == 5){ // 日常
-                            $table = 'daily';
-                        }else if($v['type'] == 6){ // 设备
+                        }
+//                        else if($v['type'] == 5){ // 日常
+//                            $table = 'daily';
+//                        }
+                        else if($v['type'] == 6){ // 设备
                             $table = 'device';
                         }
                         $buss = Db::name($table)

+ 1 - 0
application/common/model/Device.php

@@ -387,6 +387,7 @@ class Device extends Base {
             ->where('b.status','in',[0,1])
             ->field('b.id,b.title,b.start_time,b.end_time,b.status')
             ->order('b.start_time desc,b.id desc')
+            ->group('t.bus_id')
             ->distinct(true)
             ->count();
         return $record?$record:0;

+ 30 - 19
application/common/model/QualityGroup.php

@@ -52,8 +52,17 @@ class QualityGroup extends Base
 
     public function getListByType($type,$orgId){
         $ll = [];
-        if(in_array($type,[1,2,3,4])){
-            $lists = (new \app\common\model\Address())->getListByType($type+2,$orgId);
+
+        if(in_array($type,[1,2,3,4,5])){
+            $ctype = $type;
+            if(in_array($type,[1,2,3,4])){
+                $ctype = $type+2;
+            }
+            if($type == 5){
+                $ctype = 10;
+            }
+
+            $lists = (new \app\common\model\Address())->getListByType($ctype,$orgId);
             foreach ($lists as $k=>$v){
                 $ll[] = [
                     'id' => $v['id'],
@@ -62,23 +71,25 @@ class QualityGroup extends Base
                     'qrcode' => get_qrcode_str('address',$v['id'])
                 ];
             }
-        }else if($type == 5){ // 日常工作
-            $lists =  Db::name('daily')
-                ->where('del',0)
-                ->where('enable',1)
-                ->where('org_id',$orgId)
-                ->field('id,title')
-                ->select();
-            $lists = $lists?$lists:[];
-            foreach ($lists as $k=>$v){
-                $ll[] = [
-                    'id' => $v['id'],
-                    'title' => $v['title'],
-                    'sn' => '',
-                    'qrcode' => get_qrcode_str('daily',$v['id'])
-                ];
-            }
-        }else if($type == 6){ // 设备台账
+        }
+//        else if($type == 5){ // 日常工作
+//            $lists =  Db::name('daily')
+//                ->where('del',0)
+//                ->where('enable',1)
+//                ->where('org_id',$orgId)
+//                ->field('id,title')
+//                ->select();
+//            $lists = $lists?$lists:[];
+//            foreach ($lists as $k=>$v){
+//                $ll[] = [
+//                    'id' => $v['id'],
+//                    'title' => $v['title'],
+//                    'sn' => '',
+//                    'qrcode' => get_qrcode_str('daily',$v['id'])
+//                ];
+//            }
+//        }
+        else if($type == 6){ // 设备台账
             $lists =  Db::name('device')
                 ->where('del',0)
                 ->where('enable',1)