瀏覽代碼

检测数据导出

15168162575 2 年之前
父節點
當前提交
d22b818635
共有 1 個文件被更改,包括 28 次插入27 次删除
  1. 28 27
      application/admin/controller/Res.php

+ 28 - 27
application/admin/controller/Res.php

@@ -130,7 +130,8 @@ class Res extends Backend
                     $judge = '不合格';
                 }
                 $entrust = Db::name('entrust')->where('id',$res['entrust_id'])->find();
-                $gather = Db::name($entrust['gather_tab'])->where('pid',$entrust['gather_id'])->select();
+//                $gather = Db::name($entrust['gather_tab'])->where('pid',$entrust['gather_id'])->select();
+                $gather = Db::name($entrust['gather_tab'])->where('pid',$entrust['gather_id'])->column('potency','chemical_compound');
                 $data[$i] = [
                     'name' => $entrust['name'],
                     'sell_bach' => $entrust['sell_bach'],
@@ -146,32 +147,32 @@ class Res extends Backend
                     'judge' => $judge,
                     'maker' => $res['maker'],
                     'remark' => '',
-                    '0' => $gather[0]['potency'],
-                    '1' => $gather[1]['potency'],
-                    '2' => $gather[2]['potency'],
-                    '3' => $gather[3]['potency'],
-                    '4' => $gather[4]['potency'],
-                    '5' => $gather[5]['potency'],
-                    '6' => $gather[6]['potency'],
-                    '7' => $gather[7]['potency'],
-                    '8' => $gather[8]['potency'],
-                    '9' => $gather[9]['potency'],
-                    '10' => $gather[10]['potency'],
-                    '11' => $gather[11]['potency'],
-                    '12' => $gather[12]['potency'],
-                    '13' => $gather[13]['potency'],
-                    '14' => $gather[14]['potency'],
-                    '15' => $gather[15]['potency'],
-                    '16' => $gather[16]['potency'],
-                    '17' => $gather[17]['potency'],
-                    '18' => $gather[18]['potency'],
-                    '19' => $gather[19]['potency'],
-                    '20' => $gather[20]['potency'],
-                    '21' => $gather[21]['potency'],
-                    '22' => $gather[22]['potency'],
-                    '23' => $gather[23]['potency'],
-                    '24' => $gather[24]['potency'],
-                    '25' => $gather[25]['potency'],
+                    '0' => isset($gather['甲醇']) ? $gather['甲醇'] : '0',
+                    '1' => isset($gather['乙醇']) ? $gather['乙醇'] : '0',
+                    '2' => isset($gather['异丙醇']) ? $gather['异丙醇'] : '0',
+                    '3' => isset($gather['丙酮']) ? $gather['丙酮'] : '0',
+                    '4' => isset($gather['正丙醇']) ? $gather['正丙醇'] : '0',
+                    '5' => isset($gather['丁酮']) ? $gather['丁酮'] : '0',
+                    '6' => isset($gather['乙酸乙酯']) ? $gather['乙酸乙酯'] : '0',
+                    '7' => isset($gather['乙酸异丙酯']) ? $gather['乙酸异丙酯'] : '0',
+                    '8' => isset($gather['正丁醇']) ? $gather['正丁醇'] : '0',
+                    '9' => isset($gather['苯']) ? $gather['苯'] : '0',
+                    '10' => isset($gather['1-甲氧基-2-丙醇']) ? $gather['1-甲氧基-2-丙醇'] : '0',
+                    '11' => isset($gather['乙酸正丙酯']) ? $gather['乙酸正丙酯'] : '0',
+                    '12' => isset($gather['2-乙氧基乙醇']) ? $gather['2-乙氧基乙醇'] : '0',
+                    '13' => isset($gather['4-甲基-2-戊酮']) ? $gather['4-甲基-2-戊酮'] : '0',
+                    '14' => isset($gather['1-乙氧基-2-丙醇']) ? $gather['1-乙氧基-2-丙醇'] : '0',
+                    '15' => isset($gather['甲苯']) ? $gather['甲苯'] : '0',
+                    '16' => isset($gather['乙酸正丁酯']) ? $gather['乙酸正丁酯'] : '0',
+                    '17' => isset($gather['乙苯']) ? $gather['乙苯'] : '0',
+                    '18' => isset($gather['间对二甲苯']) ? $gather['间对二甲苯'] : '0',
+                    '19' => isset($gather['邻-二甲苯']) ? $gather['邻-二甲苯'] : '0',
+                    '20' => isset($gather['苯乙烯']) ? $gather['苯乙烯'] : '0',
+                    '21' => isset($gather['2-乙氧基乙基乙酸酯']) ? $gather['2-乙氧基乙基乙酸酯'] : '0',
+                    '22' => isset($gather['环己酮']) ? $gather['环己酮'] : '0',
+                    '23' => isset($gather['丁二酸二甲酯']) ? $gather['丁二酸二甲酯'] : '0',
+                    '24' => isset($gather['戊二酸二甲酯']) ? $gather['戊二酸二甲酯'] : '0',
+                    '25' => isset($gather['己二酸二甲酯']) ? $gather['己二酸二甲酯'] : '0',
                 ];
             }
             $this->exceloutput($data);