车辆管理
This commit is contained in:
parent
d8956b42bd
commit
ac19922a6d
31
application/admin/controller/wechat/Api.php
Normal file
31
application/admin/controller/wechat/Api.php
Normal 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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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设置
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user