操作日志新增条件查询,并简单优化了操作日志控制器

This commit is contained in:
tlerbao
2020-07-15 11:39:55 +08:00
parent a6ad9b63dd
commit 142fd71b56
3 changed files with 46 additions and 21 deletions

View File

@@ -0,0 +1,26 @@
<?php
namespace catchAdmin\system\model\search;
trait OperateLogSearch
{
public function searchModuleAttr($query, $value, $data)
{
return $query->whereLike('module', $value);
}
public function searchMethodAttr($query, $value, $data)
{
return $query->whereLike('method', $value);
}
public function searchCreatorAttr($query, $value, $data)
{
return $query->where('username', $value);
}
public function searchCreateAtAttr($query, $value, $data)
{
return $query->whereTime($this->aliasField('created_at'), 'between', $value);
}
}