public function test11()
{
$dbList = Db::query("show full columns from hazardous_chemicals"); //hazardous_chemicals 是数据库表名
$str = "";
foreach ($dbList as $vo) {
$comment = !empty($vo['Comment']) ? $vo['Comment'] : $vo['Field'];
if (!in_array($vo['Field'], $this->noExportFields)) {
$str .= <<<EOF
['${comment}', '${vo['Field']}'],
EOF.PHP_EOL;
}
}
return $str;
}
$header = [
[‘物料名称’, ‘title’],
[‘危化品序号’, ‘serial_number’],
[‘别名’, ‘nickname’],
[‘临界量’, ‘critical_amount’],
[‘危化品名称’, ‘name’],
[‘英文名’, ‘english_name’],
[‘危险性类别’, ‘hazard_category’],
[‘CAS号’, ‘cas’],
[‘CN号’, ‘cn’],
[‘UN号’, ‘un’],
[‘易制毒化学品’, ‘precursor_chemical’],
[‘易制爆化学品’, ‘easily_explosive_chemical’],
[‘重点监管危化品’, ‘hazardous_chemicals’],
[‘剧毒化学品’, ‘highly_toxic_chemicals’],
[‘临界值’, ‘critical_amount’],
];