update QueryLogServiceProvider
parent
0e7a40ff61
commit
17150cf734
25
README.md
25
README.md
|
|
@ -17,7 +17,7 @@
|
||||||
监听sql执行, 打印日志
|
监听sql执行, 打印日志
|
||||||
|
|
||||||
- `app/Providers/QueryLogServiceProvider.php`
|
- `app/Providers/QueryLogServiceProvider.php`
|
||||||
- `bootstrap\providers.php`
|
- `bootstrap/providers.php`
|
||||||
|
|
||||||
### 无限级分类
|
### 无限级分类
|
||||||
|
|
||||||
|
|
@ -28,3 +28,26 @@
|
||||||
| parent_id | 上级id | 默认: 0 |
|
| parent_id | 上级id | 默认: 0 |
|
||||||
| path | 所有上级id | 默认: -, 例如: -1-2-3- |
|
| path | 所有上级id | 默认: -, 例如: -1-2-3- |
|
||||||
| sort | 排序 | 正序 |
|
| sort | 排序 | 正序 |
|
||||||
|
|
||||||
|
### 修改组件鉴权 `permission` 方法
|
||||||
|
|
||||||
|
- `vendor\slowlyo\owl-admin\src\Renderers\BaseRenderer.php`
|
||||||
|
|
||||||
|
```php
|
||||||
|
public function filteredResults()
|
||||||
|
{
|
||||||
|
$permissionKey = 'owl_permission';
|
||||||
|
|
||||||
|
// if (key_exists($permissionKey, $this->amisSchema)) {
|
||||||
|
// if (!admin_user()->can($this->amisSchema[$permissionKey])) {
|
||||||
|
// return data_get($this->amisSchema, 'owl_permission_replace_value', '');
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (key_exists($permissionKey, $this->amisSchema)) {
|
||||||
|
$this->amisSchema['visible'] = admin_user()->can($this->amisSchema[$permissionKey]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return \Slowlyo\OwlAdmin\Support\Cores\AdminPipeline::handle(static::class, $this->amisSchema);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ class QueryLogServiceProvider extends ServiceProvider
|
||||||
$sql = vsprintf($sql, array_map([$query->connection->getPdo(), 'quote'], $bindings));
|
$sql = vsprintf($sql, array_map([$query->connection->getPdo(), 'quote'], $bindings));
|
||||||
}
|
}
|
||||||
|
|
||||||
return sprintf('[%s] %s', $this->formatDuration($query->time), $sql);
|
return sprintf('[%s] [%s] %s', request()->fullUrl(), $this->formatDuration($query->time), $sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue