作者 lihan
1 个管道 的构建 通过 耗费 1 秒

项目细节完善

@@ -47,7 +47,7 @@ class ActivityController extends HomeBaseController @@ -47,7 +47,7 @@ class ActivityController extends HomeBaseController
47 } 47 }
48 } 48 }
49 }else { 49 }else {
50 - //$this->error('请从微信浏览器打开'); 50 + $this->error('请从微信浏览器打开');
51 } 51 }
52 } 52 }
53 53
@@ -57,7 +57,7 @@ class IndexController extends HomeBaseController @@ -57,7 +57,7 @@ class IndexController extends HomeBaseController
57 } 57 }
58 } 58 }
59 }else { 59 }else {
60 - //$this->error('请从微信浏览器打开'); 60 + $this->error('请从微信浏览器打开');
61 } 61 }
62 } 62 }
63 63
@@ -22,7 +22,7 @@ class CenterController extends HomeBaseController @@ -22,7 +22,7 @@ class CenterController extends HomeBaseController
22 function _initialize() 22 function _initialize()
23 { 23 {
24 if (empty(session('user.id'))) { 24 if (empty(session('user.id'))) {
25 - echo json_encode(['msg' => '登陆失败', 'code' => 40001]); 25 + $this->redirect(url('portal/Index/index'));
26 exit(); 26 exit();
27 } 27 }
28 } 28 }
@@ -473,7 +473,16 @@ class CenterController extends HomeBaseController @@ -473,7 +473,16 @@ class CenterController extends HomeBaseController
473 public function comment(){ 473 public function comment(){
474 $request = request(); 474 $request = request();
475 if($request->isAjax()) { 475 if($request->isAjax()) {
476 - 476 + $data = $request->param();
  477 + $data['user_id'] = session('user.id');
  478 + $data['comment_time'] = time();
  479 + $data['activity_id'] = Db::name('order_info')->where(['id'=>$data['oid']])->value('activity_id');
  480 + unset($data['oid']);
  481 + if(Db::name('activity_comment')->insert($data)) {
  482 + $this->success('评论成功', url('user/Center/orderDetail', ['oid'=>$request->param('oid')]), true);
  483 + }else {
  484 + $this->success('评论失败', '', false);
  485 + }
477 }else { 486 }else {
478 return $this->fetch(':comment', [ 487 return $this->fetch(':comment', [
479 'oid' => request()->param('oid') 488 'oid' => request()->param('oid')
@@ -80,20 +80,24 @@ @@ -80,20 +80,24 @@
80 }) 80 })
81 81
82 $(".ok").click(function () { 82 $(".ok").click(function () {
83 - alert(rank_synthetical);  
84 $.ajax({ 83 $.ajax({
85 url:"{:url('user/Center/comment')}", 84 url:"{:url('user/Center/comment')}",
86 data:{ 85 data:{
87 oid:'{$oid}', 86 oid:'{$oid}',
88 rank_synthetical:rank_synthetical, 87 rank_synthetical:rank_synthetical,
89 rank_service:rank_service, 88 rank_service:rank_service,
90 - rank_journey:rank_journey 89 + rank_journey:rank_journey,
  90 + content:$(".idea").val()
91 }, 91 },
92 type:"POST", 92 type:"POST",
93 dataType:"JSON", 93 dataType:"JSON",
94 94
95 success: function (data) { 95 success: function (data) {
96 - 96 + if(data.data === true) {
  97 + window.location.href=data.url;
  98 + }else {
  99 + alert(data.msg);
  100 + }
97 } 101 }
98 }) 102 })
99 }) 103 })