车辆管理

This commit is contained in:
hantao 2025-07-01 18:13:26 +08:00
parent d8956b42bd
commit ac19922a6d
3 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,31 @@
<?php
namespace app\admin\controller\wechat;
use app\common\controller\Backend;
use think\Db;
/**
*
*
* @icon fa fa-circle-o
*/
class Api extends Backend
{
protected $noNeedRight = ['*'];
protected $noNeedLogin = ['*'];
public function select()
{
$series = Db::query("SELECT a.id,brand_id as pid, a.name FROM series a LEFT JOIN brands b ON a.brand_id = b.id;");
$brands = Db::query("SELECT id, 0 as pid, `name` FROM brands;");
$this->series = $series;
$this->brands = $brands;
$data = array_merge($brands,$series);
$tree = $this->buildTree($data);
$formattedTree = $this->formatTree($tree);
return $this->return_json($formattedTree);
}
}

View File

@ -647,4 +647,12 @@ class Backend extends Controller
return $formattedTree;
}
public function return_json($data = [],$msg = 'success',$code = 1){
return json([
'data' => $data,
'msg' => $msg,
'code' => $code
]);
}
}

View File

@ -221,7 +221,7 @@ return [
'host' => Env::get('redis.redis_host'), // Redis 服务器地址
'port' => Env::get('redis.redis_port'), // Redis 端口
'password' => Env::get('redis.redis_password'), // Redis 密码,如果有的话
'select' => 1,
'select' => 4,
],
// +----------------------------------------------------------------------
// | Cookie设置