|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?php
- /**
- * Created by PhpStorm.
- * User: 002-PC
- * Date: 2017/7/4
- * Time: 14:49
- */
- namespace admin\controllers\prod;
-
- use admin\service\prod\CommentService;
- use common\Controller\AdminController;
- use common\util\Util;
-
- //use common\util\Util;
- //use Yii;
- class CommentController extends AdminController
- {
-
- public function service(){
- if ($this->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);
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
-
-
-
-
-
-
-
-
|