Просмотр исходного кода

糊盒报工左侧菜单优化

unknown 4 месяцев назад
Родитель
Сommit
d628c95297
1 измененных файлов с 12 добавлено и 5 удалено
  1. 12 5
      application/api/controller/GluingReport.php

+ 12 - 5
application/api/controller/GluingReport.php

@@ -341,7 +341,7 @@ class GluingReport extends Api
             ->order('设备编组')
             ->column('rtrim(使用部门) as 使用部门');
         if (empty($department)){
-            $this->success('获取到机台数据');
+            $this->success('获取到机台数据');
         }
         $list = \db('设备_糊盒报工资料')
             ->field([
@@ -351,9 +351,7 @@ class GluingReport extends Api
             ->where('sczl_rq','>',$date)
             ->order('sczl_rq desc')
             ->select();
-        if (empty($list)){
-            $this->success('未找到机台生产记录');
-        }
+
         foreach ($department as $value){
             $machine = \db('设备_基本资料')->where('使用部门',$value)->where('sys_sbID','<>','')->where('使用部门',$value)->field('rtrim(设备编号) as 设备编号,rtrim(设备名称) as 设备名称')->order('设备编号')->select();
             foreach ($machine as $k=>$v){
@@ -388,6 +386,9 @@ class GluingReport extends Api
         $machine = $params['machine'];
         $machineCode = \db('dic_lzde')->where('适用机型',$machine)->value('sys_bh');
         $data = \db('设备_糊盒报工采集')->where('sczl_jtbh',$machine)->order('UID desc')->find();
+        if (empty($data)){
+            $this->success('未找到数据');
+        }
         $list = [];
         $list['班组ID'] = $data['班组ID'];
         $row = [];
@@ -510,7 +511,13 @@ class GluingReport extends Api
         }
     }
 
-    //糊盒设备运行跟踪数据页面显示
+    /**
+     * 糊盒设备运行跟踪数据页面显示
+     * @return void
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
     public function getGluingReportDataList()
     {
         if ($this->request->isGet() === false){