|
@@ -11,85 +11,6 @@ use Modules\OpcData\Entities\OpcDataDict;
|
|
|
|
|
|
class OpcDataController extends Controller
|
|
|
{
|
|
|
- protected $opcDB;
|
|
|
- // private $opcDictArr = array();
|
|
|
- protected $opcConnectName = 'mysql_opc_jinjiaqu';
|
|
|
- // private $dictTableName = 'tb_dev_dict_list';
|
|
|
- // private $dataTableName = 'equipment';
|
|
|
-
|
|
|
- public function __construct() {
|
|
|
- $this->opcDB = DB::connection($this->opcConnectName);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Display a listing of the resource.
|
|
|
- * @return Renderable
|
|
|
- */
|
|
|
- public function index()
|
|
|
- {
|
|
|
- return view('opcdata::index');
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Show the form for creating a new resource.
|
|
|
- * @return Renderable
|
|
|
- */
|
|
|
- public function create()
|
|
|
- {
|
|
|
- return view('opcdata::create');
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Store a newly created resource in storage.
|
|
|
- * @param Request $request
|
|
|
- * @return Renderable
|
|
|
- */
|
|
|
- public function store(Request $request)
|
|
|
- {
|
|
|
- //
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Show the specified resource.
|
|
|
- * @param int $id
|
|
|
- * @return Renderable
|
|
|
- */
|
|
|
- public function show($id)
|
|
|
- {
|
|
|
- return view('opcdata::show');
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Show the form for editing the specified resource.
|
|
|
- * @param int $id
|
|
|
- * @return Renderable
|
|
|
- */
|
|
|
- public function edit($id)
|
|
|
- {
|
|
|
- return view('opcdata::edit');
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Update the specified resource in storage.
|
|
|
- * @param Request $request
|
|
|
- * @param int $id
|
|
|
- * @return Renderable
|
|
|
- */
|
|
|
- public function update(Request $request, $id)
|
|
|
- {
|
|
|
- //
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Remove the specified resource from storage.
|
|
|
- * @param int $id
|
|
|
- * @return Renderable
|
|
|
- */
|
|
|
- public function destroy($id)
|
|
|
- {
|
|
|
- //
|
|
|
- }
|
|
|
-
|
|
|
protected $opcConf = [
|
|
|
'ventilation_zb' => 1,
|
|
|
'ventilation_bb' => 2,
|
|
@@ -105,6 +26,10 @@ class OpcDataController extends Controller
|
|
|
$getDataType = $request->system_type; // 获取需要的数据
|
|
|
$getMineCode = $request->mine_code; // 矿分类
|
|
|
$dataArr = array(); // 返回数据数组
|
|
|
+
|
|
|
+ $opcConnectName = 'mysql_opc_jinjiaqu';
|
|
|
+
|
|
|
+ $opcDB = DB::connection($opcConnectName);
|
|
|
|
|
|
if (array_key_exists($getDataType, $this->opcConf)) {
|
|
|
$groupId = $this->opcConf[$getDataType];
|
|
@@ -127,7 +52,7 @@ class OpcDataController extends Controller
|
|
|
and t1.is_show = 1
|
|
|
order by t1.dev_type_id, t1.row_number, t1.device_num, t1.device_name
|
|
|
";
|
|
|
- $dbResult = $this->opcDB->select($sqlStr);
|
|
|
+ $dbResult = $opcDB->select($sqlStr);
|
|
|
switch($getDataType) {
|
|
|
// 中部风机
|
|
|
case 'ventilation_zb':
|