service == '') { $this->service = new CommentService(); } return $this->service; } //页面处理 /** * Des:添加评论 * Name: actionAddTravel * @return string * @author 孙彤 */ public function actionAddTravel() { $param = [ 'travel_id' => $this->_post('travel_id', ''), 'prod_id' => $this->_post('prod_id', ''), 'star' => $this->_post('star', ''), 'content' => $this->_post('content', ''), 'u_id' => $this->_post('u_id'), 'create_time'=>date('Y-m-d H:i:s') ]; // var_dump($param); $addFlag = $this->service()->AddTravel($param); if ($addFlag['flag'] == false) { return Util::returnJsEr($addFlag['msg']); } return Util::returnJsSu($addFlag['msg']); } /** * Des:评论列表 * Name: actionCommentList * @return string * @author */ public function actionCommentList(){ $param=[ "current_page"=>$this->_post('current_page','1'), "page_size"=>$this->_post('page_size','10') ]; $result = $this->service()->CommentList($param); return json_encode($result); } }