You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
857 B
PHP

<?php
namespace app\admin\controller;
use think\Controller;
use think\Db;
class Wtree extends Common
{
public function index()
{
return $this->fetch('wtree');
}
public function table1(){
$date=Db::query("select paramindex from rptparamindex");
$this->assign('date',$date);
return $this->fetch('table1');
}
public function tabs()
{
return $this->fetch('tabs');
}
public function get_ajax(){
$data = Db::query("SELECT DISTINCT concat('b',bdzid) id,bmc name,0 as pId from vw_sb
UNION DISTINCT SELECT concat('j',jgid) id,jmc name,concat('b',bdzid) pId from vw_sb
UNION DISTINCT SELECT concat('z',zid) id,zmc name,concat('j',jgid) pId from vw_sb
UNION DISTINCT SELECT concat('m',id) id,name,concat('z',zid) pId from vw_sb");
echo json_encode($data);
}
public function ajax($id){
$data1 = Db::table('vw_sb')->where('id',$id)->find();
echo $data1['mtid'];
}
}
?>