|
|
@@ -41,7 +41,7 @@ class IpConfig extends BaseController
|
|
|
|
|
|
$params = (new IpConfigValidate())->post()->goCheck('edit');
|
|
|
$id = $this->request->param('id',0);
|
|
|
- $params['operator_id'] = $this->admin_id;
|
|
|
+ $params['operation_id'] = $this->admin_id;
|
|
|
if (!$id) {
|
|
|
$ip = IpConfigModel::where('ip', $params['ip'])->find();
|
|
|
if ($ip) {
|
|
|
@@ -64,27 +64,24 @@ class IpConfig extends BaseController
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @api {get} /ip/index IP查询
|
|
|
+ * @api {get} /ip/list IP查询
|
|
|
*/
|
|
|
- function index()
|
|
|
+ function list()
|
|
|
{
|
|
|
try {
|
|
|
$params = $this->request->param();
|
|
|
$page = $params['page'] ?? 1;
|
|
|
$limit = $params['limit'] ?? 15;
|
|
|
- $query = IpConfigModel::join('kefu', 'kefu.id = ip_config.operator_id', 'left');
|
|
|
- if (!empty($params['type'])) {
|
|
|
- $query->where('ip_config.type', $params['type']);
|
|
|
+ $query = IpConfigModel::alias('ip_config')->join('admin', 'admin.id = ip_config.operation_id', 'left');
|
|
|
+ if (!empty($params['keyword'])) {
|
|
|
+ $query->where('ip_config.ip', 'like', '%'.$params['keyword'].'%');
|
|
|
}
|
|
|
if (!empty($params['status'])) {
|
|
|
$query->where('ip_config.status', $params['status']);
|
|
|
}
|
|
|
- if (!empty($params['operator'])) {
|
|
|
- $query->where('kefu.name', 'like', '%'.$params['operator'].'%');
|
|
|
- }
|
|
|
$count = $query->count();
|
|
|
$list = $query
|
|
|
- ->field(['ip_config.*', 'kefu.name as operator_name'])
|
|
|
+ ->field(['ip_config.*', 'admin.nickname as operator_name'])
|
|
|
->order('updated_at','desc')
|
|
|
->limit($limit)
|
|
|
->page($page)
|