init
This commit is contained in:
30
app/controller/Monitor.php
Normal file
30
app/controller/Monitor.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace app\controller;
|
||||
|
||||
use think\facade\Db;
|
||||
|
||||
class Monitor
|
||||
{
|
||||
public function MonitorList(){
|
||||
$list =Db::table('charge_station')->column('charge_station_name');
|
||||
foreach ($list as $ll){
|
||||
$message = Db::table('rtspaddr')->field('name')->where('charge_station_name',$ll)->select()->toArray();
|
||||
$i = 0;
|
||||
foreach ($message as $mess){
|
||||
$message[$i]['station'] = $message[$i]['name'];
|
||||
array_diff_key($message[$i],['name' => 'xy']);
|
||||
$i+=1;
|
||||
}
|
||||
$kk['station'] = $ll;
|
||||
$kk['children'] = $message;
|
||||
$ss[] = $kk;
|
||||
}
|
||||
return json($ss);
|
||||
}
|
||||
|
||||
public function MonitorId($MonitorName){
|
||||
$id = Db::table('rtspaddr')->where('name',$MonitorName)->value('id');
|
||||
return json(['id' => $id]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user