mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-30 14:31:04 +00:00
Merge branch 'v5.0.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v5.0.0dev
This commit is contained in:
commit
89c400c4e5
@ -39,6 +39,6 @@ class SystemRouteCate extends BaseModel
|
||||
*/
|
||||
public function children()
|
||||
{
|
||||
return $this->hasMany(SystemRoute::class, 'id', 'cate_id')->field(['id', 'cate_id', 'name', 'path', 'method'])->order('add_time desc');
|
||||
return $this->hasMany(SystemRoute::class, 'cate_id', 'id')->field(['id', 'cate_id', 'name', 'path', 'method'])->order('add_time desc');
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ class SystemRouteCateServices extends BaseServices
|
||||
$cateInfo = $cateInfo ? $cateInfo->toArray() : [];
|
||||
$url .= '/' . $id;
|
||||
}
|
||||
$options = $this->dao->selectList(['app_name' => $appName])->toArray();
|
||||
$options = $this->dao->selectList(['app_name' => $appName], 'name as label,path as value')->toArray();
|
||||
$rule = [
|
||||
FormBuilder::select('pid', '上级分类', (int)($cateInfo['pid'] ?? 0))->options($options),
|
||||
FormBuilder::input('name', '分类名称', $cateInfo['name'] ?? '')->required(),
|
||||
|
||||
@ -82,7 +82,7 @@ class SystemRouteServices extends BaseServices
|
||||
public function getTreeList(array $where, string $appName = 'adminapi')
|
||||
{
|
||||
$list = app()->make(SystemRouteCateServices::class)
|
||||
->selectList(['app_name' => $appName], '*', 0, 0, 'id asc', [
|
||||
->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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user