Files
charge-pile-serve/app/controller/Monitor.php
MeSHard 94f7e83679 init
2025-11-10 16:12:07 +08:00

30 lines
863 B
PHP

<?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]);
}
}