mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-11-02 16:00:40 +00:00
Merge branch 'v5.0.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v5.0.0dev
This commit is contained in:
commit
0e9e42c568
@ -80,12 +80,12 @@ class SystemRoute extends AuthController
|
||||
*/
|
||||
public function tree()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
[$name, $appName] = $this->request->getMore([
|
||||
['name_like', ''],
|
||||
['app_name', 'adminapi']
|
||||
]);
|
||||
], true);
|
||||
|
||||
return app('json')->success($this->services->getTreeList($where));
|
||||
return app('json')->success($this->services->getTreeList($appName, $name));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -502,6 +502,7 @@ class SystemCrudServices extends BaseServices
|
||||
|
||||
$data['softDelete'] = false;
|
||||
|
||||
$tableInfo = null;
|
||||
//先检查表存在则
|
||||
if ($id) {
|
||||
$this->updateFromCommon($tableName, $tableComment);
|
||||
@ -525,21 +526,15 @@ class SystemCrudServices extends BaseServices
|
||||
$data['softDelete'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
//读取表结构
|
||||
$column = $this->getColumnNamesList($tableName);
|
||||
if (!$column) {
|
||||
throw new AdminException(500049, ['_name' => $tableName]);
|
||||
}
|
||||
|
||||
|
||||
//读取字段
|
||||
//读取数据库字段信息
|
||||
$tableInfo = $this->getTableInfo($tableName);
|
||||
|
||||
//获取主键
|
||||
foreach ($column as $value) {
|
||||
foreach ($tableField as $value) {
|
||||
if ($value['primaryKey']) {
|
||||
$data['key'] = $value['name'];
|
||||
$data['key'] = $value['field'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,20 +76,21 @@ class SystemRouteServices extends BaseServices
|
||||
/**
|
||||
* 获取tree数据
|
||||
* @param string $appName
|
||||
* @return array
|
||||
* @author 等风来
|
||||
* @email 136327134@qq.com
|
||||
* @date 2023/4/7
|
||||
* @param string $name
|
||||
* @return mixed
|
||||
* @author 吴汐
|
||||
* @email 442384644@qq.com
|
||||
* @date 2023/05/06
|
||||
*/
|
||||
public function getTreeList(array $where, string $appName = 'adminapi')
|
||||
public function getTreeList(string $appName = 'adminapi', string $name = '')
|
||||
{
|
||||
return $this->cacheDriver()->remember('ROUTE_LIST', function () use ($where, $appName) {
|
||||
return $this->cacheDriver()->remember('ROUTE_LIST' . strtoupper($appName), function () use ($name, $appName) {
|
||||
$list = app()->make(SystemRouteCateServices::class)
|
||||
->selectList(['app_name' => $appName], '*', 0, 0, 'id asc,sort desc', [
|
||||
'children' => function ($query) use ($where) {
|
||||
$query->where('app_name', $where['app_name'])
|
||||
->when('' !== $where['name_like'], function ($q) use ($where) {
|
||||
$q->where('name|path', 'LIKE', '%' . $where['name_like'] . '%');
|
||||
'children' => function ($query) use ($name, $appName) {
|
||||
$query->where('app_name', $appName)
|
||||
->when('' !== $name, function ($q) use ($name) {
|
||||
$q->where('name|path', 'LIKE', '%' . $name . '%');
|
||||
});
|
||||
}
|
||||
])
|
||||
|
||||
@ -190,7 +190,7 @@
|
||||
}
|
||||
.columns-round {
|
||||
.el-menu-item {
|
||||
margin: 0 5px 5px 5px;
|
||||
margin: 5px 5px 0px 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.el-submenu {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user