优化关联查询时模型表名读取

优化插件配置数据过滤
pull/146/MERGE
Karson 2019-10-10 17:52:32 +08:00
parent 5cb74b5e36
commit 3157f3a574
3 changed files with 4 additions and 3 deletions

View File

@ -61,7 +61,7 @@ class Addon extends Backend
$this->error(__('No Results were found'));
}
if ($this->request->isPost()) {
$params = $this->request->post("row/a");
$params = $this->request->post("row/a", [], 'trim');
if ($params) {
foreach ($config as $k => &$v) {
if (isset($params[$v['name']])) {

View File

@ -74,7 +74,7 @@ class Config extends Backend
{
if ($this->request->isPost()) {
$this->token();
$params = $this->request->post("row/a");
$params = $this->request->post("row/a", [], 'trim');
if ($params) {
foreach ($params as $k => &$v) {
$v = is_array($v) ? implode(',', $v) : $v;
@ -113,7 +113,7 @@ class Config extends Backend
{
if ($this->request->isPost()) {
$this->token();
$row = $this->request->post("row/a");
$row = $this->request->post("row/a", [], 'trim');
if ($row) {
$configList = [];
foreach ($this->model->all() as $v) {

View File

@ -267,6 +267,7 @@ class Backend extends Controller
if ($relationSearch) {
if (!empty($this->model)) {
$name = \think\Loader::parseName(basename(str_replace('\\', '/', get_class($this->model))));
$name = $this->model->getTable();
$tableName = $name . '.';
}
$sortArr = explode(',', $sort);