<?php

namespace app\index\controller;
use think\Controller;
use think\Db;
class Sline extends Controller
{
public function index()
{
if (empty($_GET['id'])) die('无效的编号');
$id = $_GET['id'];
$this->assign('id',$id);
return $this->fetch('sline');
}
public function getjson()
{
if (empty($_GET['sid'])) return;
$sid = $_GET['sid'];
$b = Db::query("select d_Time,CH4ppm,C2H4ppm,C2H6ppm,C2H2ppm,H2ppm,COppm,CO2ppm,TotalHydrocarbon from data_epa_h where EQMID='{$sid}'");
$data = json_encode($b);
echo $data;
}
}
?>