Skip to content

Commit

Permalink
fix device page error
Browse files Browse the repository at this point in the history
  • Loading branch information
gaojia1996 committed Jan 18, 2019
1 parent d3edf2c commit e4c81f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions app/Http/Controllers/device/deviceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ public function input($input){
public function data($input){
$DevAddr=DB::table('DeviceInfo')->where('DevEUI',$input)->value('DevAddr');
$device = DB::table('DeviceInfo')->where('DevEUI',$input)->first();
$datas = DB::connection('mongodb')->collection('lora_productKey_'.$device->productKey)->where('DevAddr',$DevAddr)
->where('msgType', 'UPLINK_MSG')->orderBy('createdTime', 'desc')->paginate(10);
$datas = DB::connection('mongodb')->collection('lora_appeui_'.$device->AppEUI)->where('DevAddr',$DevAddr)
->where('msgType', 'DOWNLINK_MSG')->orderBy('createdTime', 'desc')->paginate(10);
return view('device/data')->with(['input'=>$input,'data'=>$datas]);
}
//设备应用数据页面
Expand Down Expand Up @@ -395,7 +395,7 @@ public function downLink($input){
$success='';
$DevAddr=DB::table('DeviceInfo')->where('DevEUI',$input)->value('DevAddr');
$device = DB::table('DeviceInfo')->where('DevEUI',$input)->first();
$datas = DB::connection('mongodb')->collection('lora_productKey_'.$device->productKey)->where('DevAddr',$DevAddr)
$datas = DB::connection('mongodb')->collection('lora_appeui_'.$device->AppEUI)->where('DevAddr',$DevAddr)
->where('msgType', 'UPLINK_MSG')->orderBy('createdTime', 'desc')->paginate(10);
return view('device/downlink')->with(['success'=>$success,'input'=>$input,'data'=>$datas]);
}
Expand Down
8 changes: 4 additions & 4 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@
Route::match(['get', 'post'], '/', 'deviceController@index');//设备管理首页
Route::post('/register', 'deviceController@register');//注册后台处理
Route::get('/{input}', 'deviceController@input');//转至该设备下具体数据展示
Route::get('/{input}/data', 'deviceController@data');//设备的传输数据展示
Route::get('/{input}/data/uplink', 'deviceController@upLink'); //设备上行数据的发送页面
Route::get('/{input}/data/downlink', 'deviceController@downLink'); //设备下行数据的发送页面
Route::post('/{input}/data/downlink', 'deviceController@downLinkPost');//设备下行数据存储数据库
Route::get('/{input}/data', 'deviceController@data');//设备的上行数据页面
// Route::get('/{input}/data/uplink', 'deviceController@upLink'); //设备应用数据页面,暂未使用
Route::get('/{input}/data/downlink', 'deviceController@downLink'); //设备下行数据页面
// Route::post('/{input}/data/downlink', 'deviceController@downLinkPost');//设备下行数据存储数据库
Route::get('/{input}/setting', 'deviceController@setting');//设备更改设置页面
Route::post('/{input}/setting', 'deviceController@settingPost');//设置修改的存储
Route::get('/{input}/setting/appeui', 'deviceController@settingAppEUI');
Expand Down

0 comments on commit e4c81f9

Please sign in to comment.