getFeedbackList($condition,10); /* 设置买家当前菜单 */ $this->setMemberCurMenu('member_feedback'); /* 设置买家当前栏目 */ $this->setMemberCurItem('feedback_list'); //文章 $article_model = model('article'); $condition = array(); $condition[]=array('article_show','=','1'); $condition[]=array('ac_id','=','10'); $article_list = $article_model->getAllArticle($condition, 10); foreach ($article_list as &$val) { $val['article_date'] = date('Y-m-d H:i:s',$val['article_time']); preg_match_all('/[\x{4e00}-\x{9fff}]+/u', $val['article_content'], $matches); $str = join('', $matches[0]); $val['article'] = mb_substr($str,0,200); } View::assign('article', $article_list); View::assign('feedback_list', $feedback_list); View::assign('show_page', $feedback_model->page_info->render()); return View::fetch($this->template_dir . 'index'); } public function add(){ if (request()->isPost()) { $feedback_model = model('feedback'); $param = array(); if (!empty(input('param.email'))) { if (!empty(input('param.fname'))) { $param['fb_content'] = input('param.school').':'.input('param.fname').'-'.input('param.lname'); } else { $param['fb_content'] = 'View syllabus'; } $param['fb_code'] = input('fb_code'); $param['fb_course'] = input('fb_course'); $param['fb_school'] = input('fb_school'); $param['fb_type'] = 2; $param['fb_time'] = TIMESTAMP; $param['member_id'] = input('param.email'); $param['member_name'] = input('param.email'); } $res=word_filter($param['fb_content']); if(!$res['code']){ ds_json_encode(10001,'Error'); } $param['fb_content']=$res['data']['text']; $result = $feedback_model->addFeedback($param); if ($result) { ds_json_encode(10000, 'Success'); } else { ds_json_encode(10001, 'Error'); } }else{ $this->setMemberCurMenu('member_feedback'); /* 设置买家当前栏目 */ $this->setMemberCurItem('feedback_add'); return View::fetch($this->template_dir . 'add'); } } /** * 用户中心右边,小导航 * * @param string $menu_type 导航类型 * @param string $menu_key 当前导航的menu_key * @param array $array 附加菜单 * * @return */ public function getMemberItemList() { $menu_array = array( array( 'name' => 'feedback_list', 'text' => lang('feedback_list'), 'url' => url('Memberfeedback/index') ), array( 'name' => 'feedback_add', 'text' => lang('feedback_add'), 'url' => url('Memberfeedback/add'), ) ); return $menu_array; } }