diff --git a/config/define.php b/config/define.php index d39d36e..bb4174c 100644 --- a/config/define.php +++ b/config/define.php @@ -37,8 +37,8 @@ 'password' => 'ausuogizwarnbfej' ), ); - define('USER_CASE_LIST_HTML_URL', TCM_DOMAIN . '/export_case_list'); - define('USER_CASE_HTML_URL', TCM_DOMAIN . '/export_case'); + define('USER_CASE_LIST_HTML_URL', TCM_DOMAIN . '/user_case_list'); + define('USER_CASE_HTML_URL', TCM_DOMAIN . '/user_case'); define('USER_CASE_PDF_PATH', DATACENTER_ROOT.'/tcm_pdf/%d/'); define('USER_CASE_PDF_URL', TCM_DOMAIN.'/case_pdf/%d/%s.pdf'); diff --git a/control/index.php b/control/index.php index 48360c6..804d8a1 100644 --- a/control/index.php +++ b/control/index.php @@ -251,7 +251,8 @@ class index extends publicBase { $res = json_decode($return, 1); if (isset($res['info'])) $this->ajax_json(false, $res['info']); - $pdf_url = $m_user_case->createPdf($uid, $return); + $pdf_name = md5($uid . $page_num . $page_size); + $pdf_url = $m_user_case->createPdf($uid, $pdf_name, $return); $total = $m_user_case->getUserCaseListCount($uid); $rdata = array( @@ -286,12 +287,13 @@ class index extends publicBase { $res = json_decode($return, 1); if (isset($res['info'])) $this->ajax_json(false, $res['info']); - $pdf_url = $m_user_case->createPdf($uid, $return); + $pdf_name = md5($uid . $id); + $pdf_url = $m_user_case->createPdf($uid, $pdf_name, $return); $this->ajax_json(true, '获取成功', array('pdf_url' => $pdf_url)); } - public function export_case_list() { + public function user_case_list() { $uid = $this->post('uid'); $token = $this->post('token'); if (empty($uid) || empty($token)) $this->ajax_json(false, '非法请求'); @@ -311,7 +313,7 @@ class index extends publicBase { $this->setViewTpl('index/export_pdf.html'); } - public function export_case() { + public function user_case() { $uid = $this->post('uid'); $token = $this->post('token'); $id = $this->post('id') + 0; diff --git a/model/mUserCase.php b/model/mUserCase.php index 910a084..fbb7a5f 100644 --- a/model/mUserCase.php +++ b/model/mUserCase.php @@ -290,9 +290,7 @@ class mUserCase extends mBase { return $data; } - public function createPdf($uid, $pdf_html) { - $pdf_name = md5($uid); - + public function createPdf($uid, $pdf_name, $pdf_html) { $temp_dir = sprintf(USER_CASE_PDF_PATH, $uid); if (!is_dir($temp_dir)) { mkdir($temp_dir, 0755, true);