log 展示
This commit is contained in:
@@ -11,7 +11,7 @@ use think\Model;
|
||||
|
||||
class BaseModel extends Model
|
||||
{
|
||||
const LIMIT = 20;
|
||||
const LIMIT = 10;
|
||||
|
||||
/**
|
||||
* Store Data
|
||||
|
@@ -7,8 +7,30 @@
|
||||
*/
|
||||
namespace app\model;
|
||||
|
||||
use http\Env\Request;
|
||||
|
||||
class LogRecordModel extends BaseModel
|
||||
{
|
||||
protected $name = 'option_log';
|
||||
|
||||
/**
|
||||
* 日志列表
|
||||
*
|
||||
* @time at 2019年01月18日
|
||||
* @param array $params
|
||||
* @param int $limit
|
||||
* @return mixed
|
||||
*/
|
||||
public function getAll(array $params, $limit = self::LIMIT)
|
||||
{
|
||||
if (!count($params)) {
|
||||
return $this->paginate($limit, false, ['query' => request()->param()]);
|
||||
}
|
||||
|
||||
if (isset($params['name'])) {
|
||||
$list = $this->whereLike('user_name', '%'.$params['name'].'%');
|
||||
}
|
||||
|
||||
return $list->paginate($limit, false, ['query' => request()->param()]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user