Commit 13c84791 authored by 冯超鹏's avatar 冯超鹏

no message

parent 1c904c2a
...@@ -28,7 +28,7 @@ class SwooleCommandController extends Controller ...@@ -28,7 +28,7 @@ class SwooleCommandController extends Controller
public function chemicals($id) public function chemicals($id)
{ {
$uid = $this->isadmin($id); $uid = $this->parseAbilityAndArgumentsadmin($id);
$databadevice = DB::table('device'); $databadevice = DB::table('device');
if($uid == 1){ if($uid == 1){
$devicelist = $databadevice $devicelist = $databadevice
...@@ -64,7 +64,7 @@ class SwooleCommandController extends Controller ...@@ -64,7 +64,7 @@ class SwooleCommandController extends Controller
public function fire($id) public function fire($id)
{ {
$uid = $this->isadmin($id); $uid = $this->parseAbilityAndArgumentsadmin($id);
$databadevice = DB::table('device'); $databadevice = DB::table('device');
if($uid == 1){ if($uid == 1){
$devicelist = $databadevice $devicelist = $databadevice
...@@ -102,7 +102,7 @@ class SwooleCommandController extends Controller ...@@ -102,7 +102,7 @@ class SwooleCommandController extends Controller
//监测是否设备报警 //监测是否设备报警
public function alarm($id) public function alarm($id)
{ {
$uid = $this->isadmin($id); $uid = $this->parseAbilityAndArgumentsadmin($id);
if ($uid == 1) { if ($uid == 1) {
$isalarm = DB::table('reportpolice') $isalarm = DB::table('reportpolice')
->where('status', '=', '1') ->where('status', '=', '1')
...@@ -126,7 +126,7 @@ class SwooleCommandController extends Controller ...@@ -126,7 +126,7 @@ class SwooleCommandController extends Controller
return $this->jsonErrorData(105, '当前无报警'); return $this->jsonErrorData(105, '当前无报警');
} }
} }
public function isadmin($id) public function parseAbilityAndArgumentsadmin($id)
{ {
$isadmin = DB::table('users')->where('id','=',$id)->value('isadmin'); $isadmin = DB::table('users')->where('id','=',$id)->value('isadmin');
return $isadmin; return $isadmin;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment