<?php

namespace app\index\controller;
use think\Controller;
use think\Db;
class Ltest extends Controller
{
public function index()
{
return $this->fetch('ltest');
}
public function getjson()
{
$b = Db::query("select d_time,pt1,lc1,rc1,pt2,lc2,rc2,pt3,lc3,rc3 from data_moa_h");
foreach($b as $k=>$v){
foreach($v as $k1=>$v1 ){
if($k1 != 'd_time'){
$b[$k][$k1] = floatval($v1);
}
}
}
$data = json_encode($b);
echo $data;
}
}
?>