renderJson(1, $msg, $data)); } /** * 返回操作失败json */ protected function renderError($msg = 'error', $data = [], $status = 0) { return json($this->renderJson($status, $msg, $data)); } /** * 返回layui.table格式的数据 */ protected function renderTable($msg = 'success', $count = 0, $data = [], $code = 0) { return json([ 'code' => $code, 'msg' => $msg, 'count' => $count, 'data' => $data ]); } /** * 获取post数据 (数组) */ protected function postData($key = null) { return $this->request->param(is_null($key) ? '' : $key . '/a'); } /** * 获取post数据 (数组) */ protected function getData($key = null) { return $this->request->get(is_null($key) ? '' : $key); } }