request->param(); $this->successWithData(Db::name('common_info')->where([ 'condition_from' => $condition['condition'] ])->select()->toArray()); } public function update() { $params = $this->request->post(); $params['create_at'] = getNormalDate(); Db::name('common_info')->where([ 'id' => $params['id'] ])->update(convertKeysCamelToSnakeRecursive($params)); $info = Db::name('common_info')->where([ 'id' => $params['id'] ])->find(); cache('common_info:'.$info['type'], null); $this->success(); } public function type() { $get = $this->request->param(); if(empty($get['num'])) { $this->error('type 不能为空'); } $data = convertToCamelCase(Db::connect(config('think-orm.search_library'))->name('common_info')->where('type', $get['num'])->find()); $this->success('ok', $data); } }