Skip to content

Commit e4c81f9

Browse files
committed
fix device page error
1 parent d3edf2c commit e4c81f9

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

app/Http/Controllers/device/deviceController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ public function input($input){
235235
public function data($input){
236236
$DevAddr=DB::table('DeviceInfo')->where('DevEUI',$input)->value('DevAddr');
237237
$device = DB::table('DeviceInfo')->where('DevEUI',$input)->first();
238-
$datas = DB::connection('mongodb')->collection('lora_productKey_'.$device->productKey)->where('DevAddr',$DevAddr)
239-
->where('msgType', 'UPLINK_MSG')->orderBy('createdTime', 'desc')->paginate(10);
238+
$datas = DB::connection('mongodb')->collection('lora_appeui_'.$device->AppEUI)->where('DevAddr',$DevAddr)
239+
->where('msgType', 'DOWNLINK_MSG')->orderBy('createdTime', 'desc')->paginate(10);
240240
return view('device/data')->with(['input'=>$input,'data'=>$datas]);
241241
}
242242
//设备应用数据页面
@@ -395,7 +395,7 @@ public function downLink($input){
395395
$success='';
396396
$DevAddr=DB::table('DeviceInfo')->where('DevEUI',$input)->value('DevAddr');
397397
$device = DB::table('DeviceInfo')->where('DevEUI',$input)->first();
398-
$datas = DB::connection('mongodb')->collection('lora_productKey_'.$device->productKey)->where('DevAddr',$DevAddr)
398+
$datas = DB::connection('mongodb')->collection('lora_appeui_'.$device->AppEUI)->where('DevAddr',$DevAddr)
399399
->where('msgType', 'UPLINK_MSG')->orderBy('createdTime', 'desc')->paginate(10);
400400
return view('device/downlink')->with(['success'=>$success,'input'=>$input,'data'=>$datas]);
401401
}

routes/web.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@
6262
Route::match(['get', 'post'], '/', 'deviceController@index');//设备管理首页
6363
Route::post('/register', 'deviceController@register');//注册后台处理
6464
Route::get('/{input}', 'deviceController@input');//转至该设备下具体数据展示
65-
Route::get('/{input}/data', 'deviceController@data');//设备的传输数据展示
66-
Route::get('/{input}/data/uplink', 'deviceController@upLink'); //设备上行数据的发送页面
67-
Route::get('/{input}/data/downlink', 'deviceController@downLink'); //设备下行数据的发送页面
68-
Route::post('/{input}/data/downlink', 'deviceController@downLinkPost');//设备下行数据存储数据库
65+
Route::get('/{input}/data', 'deviceController@data');//设备的上行数据页面
66+
// Route::get('/{input}/data/uplink', 'deviceController@upLink'); //设备应用数据页面,暂未使用
67+
Route::get('/{input}/data/downlink', 'deviceController@downLink'); //设备下行数据页面
68+
// Route::post('/{input}/data/downlink', 'deviceController@downLinkPost');//设备下行数据存储数据库
6969
Route::get('/{input}/setting', 'deviceController@setting');//设备更改设置页面
7070
Route::post('/{input}/setting', 'deviceController@settingPost');//设置修改的存储
7171
Route::get('/{input}/setting/appeui', 'deviceController@settingAppEUI');

0 commit comments

Comments
 (0)