where(['status'=>1])->select(); return $this->buildSuccess($sys_config); } // 系统参数修改 public function systemConfigEdit(){ $id = $this->request->post('id'); $value = $this->request->post('value'); if (empty($id)) { return $this->buildFailed('参数错误'); } $result = Db::name('system_config')->where(['id'=>$id])->find(); if ($result['value'] == $value) { return $this->buildFailed('重复修改,请确认后再修改!'); } if ($result['name'] == 'INQUIRY_PERIOD' && !preg_match("/^[1-9][0-9]*$/", $value)) { return $this->buildFailed('参数值不是正整数,请重新输入!'); } $upd = Db::name('system_config')->where(['id'=>$id])->update(['value'=>$value]); if ($upd) { return $this->buildSuccess('', '参数值修改成功'); } else { return $this->buildFailed('参数值修改失败'); } } }