mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-31 15:00:52 +00:00
修改添加分类为多级
This commit is contained in:
parent
f701fc87ac
commit
d928ca1523
@ -37,7 +37,7 @@ class SystemRouteCate extends BaseModel
|
||||
* @email 136327134@qq.com
|
||||
* @date 2023/4/7
|
||||
*/
|
||||
public function childrenList()
|
||||
public function children()
|
||||
{
|
||||
return $this->hasMany(SystemRoute::class, 'cate_id', 'id')->field(['id', 'cate_id', 'name', 'path', 'method'])->order('add_time desc');
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ class SystemRouteServices extends BaseServices
|
||||
{
|
||||
$list = app()->make(SystemRouteCateServices::class)
|
||||
->selectList(['app_name' => $appName], '*', 0, 0, 'id asc,sort desc', [
|
||||
'childrenList' => function ($query) use ($where) {
|
||||
'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'] . '%');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user