环境:
docker Version: 18.06.3-ce
mysql 5.7
chemex 3.4
vmware 16.0
问题描述:
chemex系统资产设备那原始二维码,显示的是资产编号的二维码,想修改为该资产编号的显示链接,实现扫码可查看该资产详细信息
解决方案:
1.docker 容器里修改文件位置: /app/Admin/Controllers/DeviceRecordController.php
原内容:
$grid->column('asset_number_qrcode', '', $sort_columns)->qrcode(function () {
return $this->asset_number;
});
修改后内容:
$grid->column('asset_number_qrcode', '', $sort_columns)->qrcode(function () {
return "http://192.168.1.11/device/records/$this->id";
});
/**
192.168.1.11是你自己的服务chemexIP地址
2.进入docker容器
```bash
root@localhost ~]# docker exec -it 8f35e24eeb27 /bin/bash
root@8f35e24eeb27:/var/www/html# ls
LICENSE app bootstrap config index.nginx-debian.html phpunit.xml resources server.php tests webpack.mix.js
README.md artisan composer.json database package.json public routes storage vendor
找到DeviceRecordController.php修改
root@8f35e24eeb27:/var/www/html# vim app/Admin/Controllers/DeviceRecordController.php
修改后
3.退出容器
root@8f35e24eeb27:/var/www/html# exit
exit
4.重启容器
[root@localhost ~]# docker restart 8f35e24eeb27
8f35e24eeb27
5.资产-设备-测试扫描
扫描后