管理员新增渠道channel_id和代理angent_id
This commit is contained in:
@@ -43,8 +43,7 @@ class Manage extends Backend
|
||||
}
|
||||
|
||||
if ($request->get('select') || $request->post('select')) {
|
||||
$this->_select();
|
||||
return $this->success();
|
||||
return $this->select($request);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,6 +80,28 @@ class Manage extends Backend
|
||||
return $this->success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道下拉选择(供 remoteSelect 使用)
|
||||
*/
|
||||
public function select(\Webman\Http\Request $request): \support\Response
|
||||
{
|
||||
$response = $this->initializeBackend($request);
|
||||
if ($response !== null) {
|
||||
return $response;
|
||||
}
|
||||
list($where, $alias, $limit, $order) = $this->queryBuilder();
|
||||
$res = $this->model
|
||||
->field('id,name,title')
|
||||
->alias($alias)
|
||||
->where($where)
|
||||
->order($order)
|
||||
->paginate($limit);
|
||||
return $this->success('', [
|
||||
'list' => $res->items(),
|
||||
'total' => $res->total(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* add、edit、del、sortable 已由父类 Backend 实现,无需重写即可直接使用
|
||||
* 若需重写,请确保调用 initializeBackend($request) 并传入 Request 参数
|
||||
|
||||
Reference in New Issue
Block a user