首頁 > 陀螺匠 > 接收数据保存和搜索条件的接收处理 app/Http/Controller/AdminApi/ 中的接收数据处理

接收数据保存和搜索条件的接收处理 app/Http/Controller/AdminApi/ 中的接收数据处理

app/Http/Controller/AdminApi/ 中的接收数据处理


//搜索的字段接收
    protected function getSearchField(): array
    {
        return [
            ['name', '', 'name_like'],
            ['types', '', 'type_name'],
            ['type_id', ''],
            ['level', ''],
            ['pid', ''],
            ['status', ''],
            ['isCityShow', ''],
        ];
    }


//亲增,修改,保存数据接收
    protected function getRequestFields(): array
    {
        return [
            ['name', ''],
            ['value', ''],
            ['type_id', 0],
            ['pid', ''],
            ['sort', 0],
            ['color', ''],
            ['status', 1],
            ['mark', ''],
        ];
    }


使用

$where = $this->request->getMore($this->getSearchField());


        $where = $this->request->getMore([
            ['pid', ''],
            ['title', ''],
            ['uid', $this->uuid],
        ]);

还有这种写法

  $this->service->resourceUpdate($id, $this->request->postMore($this->getRequestFields()));


也是能传数据传入进去


相关资讯
最新资讯
码帮你 码帮你-开源的网站,小程序,app企业应用系统,所有平台上的源码都是我们自主开发,可以放心商业使用,在我们这里能便宜就买到正版受权的网站系统源码。