正在显示
5 个修改的文件
包含
94 行增加
和
54 行删除
| @@ -50,10 +50,18 @@ class InvitationController extends Controller | @@ -50,10 +50,18 @@ class InvitationController extends Controller | ||
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | // 显示后台帖子详情 | 52 | // 显示后台帖子详情 |
| 53 | - public function detail() | 53 | + public function detail(Request $request) |
| 54 | { | 54 | { |
| 55 | + $id = $request->id; | ||
| 56 | + // 获取数据库中所有用户信息 | ||
| 57 | + $data = DB::table('planet_article as T1') | ||
| 58 | + ->join('planet_user as T2', 'T1.uuid', '=', 'T2.uuid') | ||
| 59 | + ->join('planet_label as T3', 'T1.label_id', '=', 'T3.id') | ||
| 60 | + ->where('T1.id', $id) | ||
| 61 | + ->first(['T1.id','T1.title','T1.gmt_create','T1.gmt_modified','T1.content','T1.is_audit','T2.email','T3.name']); | ||
| 62 | + | ||
| 55 | // 加载视图 渲染页面 | 63 | // 加载视图 渲染页面 |
| 56 | - return view('admin.invitation.detail'); | 64 | + return view('admin.invitation.detail', ['data'=>$data]); |
| 57 | } | 65 | } |
| 58 | 66 | ||
| 59 | // 显示后台帖子删除理由页面 | 67 | // 显示后台帖子删除理由页面 |
| @@ -111,4 +119,19 @@ class InvitationController extends Controller | @@ -111,4 +119,19 @@ class InvitationController extends Controller | ||
| 111 | return ['info'=>0,'error'=>$error]; | 119 | return ['info'=>0,'error'=>$error]; |
| 112 | } | 120 | } |
| 113 | } | 121 | } |
| 122 | + | ||
| 123 | + // 删除帖子 | ||
| 124 | + public function delete(Request $request) | ||
| 125 | + { | ||
| 126 | + $id = $request->id; | ||
| 127 | + $res = DB::table('planet_article')->where('id', $id)->delete(); | ||
| 128 | + | ||
| 129 | + // 返回受影响的行数 | ||
| 130 | + if ( $res ) { | ||
| 131 | + return ['info' => 1]; | ||
| 132 | + } else { | ||
| 133 | + $error = ''; | ||
| 134 | + return ['info'=>0,'error'=>$error]; | ||
| 135 | + } | ||
| 136 | + } | ||
| 114 | } | 137 | } |
| @@ -8,6 +8,7 @@ | @@ -8,6 +8,7 @@ | ||
| 8 | <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> | 8 | <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> |
| 9 | <meta http-equiv="Cache-Control" content="no-siteapp" /> | 9 | <meta http-equiv="Cache-Control" content="no-siteapp" /> |
| 10 | <link rel="Bookmark" href="favicon.ico" > | 10 | <link rel="Bookmark" href="favicon.ico" > |
| 11 | +{{--<link rel="Shortcut Icon" href="http://ap-guangzhou-1257892306.cos.ap-guangzhou.myqcloud.com/flow_planet/fd88ca94-70e5-42cc-bef1-940ba728aa28.png" />--}} | ||
| 11 | <link rel="Shortcut Icon" href="favicon.ico" /> | 12 | <link rel="Shortcut Icon" href="favicon.ico" /> |
| 12 | <!--[if lt IE 9]> | 13 | <!--[if lt IE 9]> |
| 13 | <script type="text/javascript" src="lib/html5.js"></script> | 14 | <script type="text/javascript" src="lib/html5.js"></script> |
| @@ -12,25 +12,37 @@ | @@ -12,25 +12,37 @@ | ||
| 12 | <div class="row cl"> | 12 | <div class="row cl"> |
| 13 | <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>账号:</label> | 13 | <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>账号:</label> |
| 14 | <div class="formControls col-xs-8 col-sm-9"> | 14 | <div class="formControls col-xs-8 col-sm-9"> |
| 15 | - <input type="text" class="input-text" disabled="disabled" value="" placeholder="" id="username" name="username"> | 15 | + <input type="text" class="input-text" readonly="readonly" value="{{$data->email}}" placeholder="" id="username" name="username"> |
| 16 | </div> | 16 | </div> |
| 17 | </div> | 17 | </div> |
| 18 | <div class="row cl"> | 18 | <div class="row cl"> |
| 19 | <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>帖子标题:</label> | 19 | <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>帖子标题:</label> |
| 20 | <div class="formControls col-xs-8 col-sm-9"> | 20 | <div class="formControls col-xs-8 col-sm-9"> |
| 21 | - <input type="text" class="input-text" disabled="disabled" value="" placeholder="" id="username" name="username"> | 21 | + <input type="text" class="input-text" readonly="readonly" value="{{$data->title}}" placeholder="" id="username" name="username"> |
| 22 | </div> | 22 | </div> |
| 23 | </div> | 23 | </div> |
| 24 | <div class="row cl"> | 24 | <div class="row cl"> |
| 25 | <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>帖子标签:</label> | 25 | <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>帖子标签:</label> |
| 26 | <div class="formControls col-xs-8 col-sm-9"> | 26 | <div class="formControls col-xs-8 col-sm-9"> |
| 27 | - <input type="text" class="input-text" disabled="disabled" value="" placeholder="" id="mobile" name="mobile"> | 27 | + <input type="text" class="input-text" readonly="readonly" value="{{$data->name}}" placeholder="" id="mobile" name="mobile"> |
| 28 | </div> | 28 | </div> |
| 29 | </div> | 29 | </div> |
| 30 | <div class="row cl"> | 30 | <div class="row cl"> |
| 31 | + <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>创建时间:</label> | ||
| 32 | + <div class="formControls col-xs-8 col-sm-9"> | ||
| 33 | + <input type="text" class="input-text" readonly="readonly" value="{{$data->gmt_create}}" placeholder="" id="username" name="username"> | ||
| 34 | + </div> | ||
| 35 | + </div> | ||
| 36 | + <div class="row cl"> | ||
| 37 | + <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>审核时间:</label> | ||
| 38 | + <div class="formControls col-xs-8 col-sm-9"> | ||
| 39 | + <input type="text" class="input-text" readonly="readonly" value="{{$data->gmt_modified}}" placeholder="" id="username" name="username"> | ||
| 40 | + </div> | ||
| 41 | + </div> | ||
| 42 | + <div class="row cl"> | ||
| 31 | <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>帖子内容:</label> | 43 | <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>帖子内容:</label> |
| 32 | <div class="formControls col-xs-8 col-sm-9"> | 44 | <div class="formControls col-xs-8 col-sm-9"> |
| 33 | - <input type="text" class="input-text" disabled="disabled" value="" placeholder="" id="mobile" name="mobile"> | 45 | + <textarea rows="4" readonly="readonly" cols="116">{{$data->content}}</textarea> |
| 34 | </div> | 46 | </div> |
| 35 | </div> | 47 | </div> |
| 36 | </form> | 48 | </form> |
| @@ -47,45 +59,7 @@ | @@ -47,45 +59,7 @@ | ||
| 47 | <script type="text/javascript" src="/admin/lib/jquery.validation/1.14.0/messages_zh.js"></script> | 59 | <script type="text/javascript" src="/admin/lib/jquery.validation/1.14.0/messages_zh.js"></script> |
| 48 | <script type="text/javascript"> | 60 | <script type="text/javascript"> |
| 49 | $(function(){ | 61 | $(function(){ |
| 50 | - $('.skin-minimal input').iCheck({ | ||
| 51 | - checkboxClass: 'icheckbox-blue', | ||
| 52 | - radioClass: 'iradio-blue', | ||
| 53 | - increaseArea: '20%' | ||
| 54 | - }); | ||
| 55 | - | ||
| 56 | - $("#form-member-add").validate({ | ||
| 57 | - rules:{ | ||
| 58 | - username:{ | ||
| 59 | - required:true, | ||
| 60 | - minlength:2, | ||
| 61 | - maxlength:16 | ||
| 62 | - }, | ||
| 63 | - sex:{ | ||
| 64 | - required:true, | ||
| 65 | - }, | ||
| 66 | - mobile:{ | ||
| 67 | - required:true, | ||
| 68 | - isMobile:true, | ||
| 69 | - }, | ||
| 70 | - email:{ | ||
| 71 | - required:true, | ||
| 72 | - email:true, | ||
| 73 | - }, | ||
| 74 | - uploadfile:{ | ||
| 75 | - required:true, | ||
| 76 | - }, | ||
| 77 | - | ||
| 78 | - }, | ||
| 79 | - onkeyup:false, | ||
| 80 | - focusCleanup:true, | ||
| 81 | - success:"valid", | ||
| 82 | - submitHandler:function(form){ | ||
| 83 | - $(form).ajaxSubmit(); | ||
| 84 | - var index = parent.layer.getFrameIndex(window.name); | ||
| 85 | - parent.$('.btn-refresh').click(); | ||
| 86 | - parent.layer.close(index); | ||
| 87 | - } | ||
| 88 | - }); | 62 | + |
| 89 | }); | 63 | }); |
| 90 | </script> | 64 | </script> |
| 91 | <!--/请在上方写此页面业务相关的脚本--> | 65 | <!--/请在上方写此页面业务相关的脚本--> |
| @@ -35,14 +35,14 @@ | @@ -35,14 +35,14 @@ | ||
| 35 | <thead> | 35 | <thead> |
| 36 | <tr class="text-c"> | 36 | <tr class="text-c"> |
| 37 | {{-- <th width="25">全选<input type="checkbox" name="checkbox" value=""></th>--}} | 37 | {{-- <th width="25">全选<input type="checkbox" name="checkbox" value=""></th>--}} |
| 38 | - <th width="80">ID</th> | ||
| 39 | - <th width="100">账号</th> | 38 | + <th width="30">ID</th> |
| 39 | + <th width="120">账号</th> | ||
| 40 | <th width="150">帖子标题</th> | 40 | <th width="150">帖子标题</th> |
| 41 | - <th width="150">帖子标签</th> | ||
| 42 | - <th width="150">帖子内容</th> | ||
| 43 | - <th width="250">创建/审核时间</th> | ||
| 44 | - <th width="70">审核状态</th> | ||
| 45 | - <th width="200">操作</th> | 41 | + <th width="90">帖子标签</th> |
| 42 | + <th width="100">帖子内容</th> | ||
| 43 | + <th width="200">创建/审核时间</th> | ||
| 44 | + <th width="60">审核状态</th> | ||
| 45 | + <th width="250">操作</th> | ||
| 46 | </tr> | 46 | </tr> |
| 47 | </thead> | 47 | </thead> |
| 48 | <tbody> | 48 | <tbody> |
| @@ -64,18 +64,24 @@ | @@ -64,18 +64,24 @@ | ||
| 64 | @endif | 64 | @endif |
| 65 | </td> | 65 | </td> |
| 66 | <td class="td-manage"> | 66 | <td class="td-manage"> |
| 67 | + <a href="javascript:;" onclick="ini_show('帖子详情','<?php echo '/admin/invitation/detail/'.$v->id; ?>','','1000')" class="btn btn-primary radius">详情</a> | ||
| 67 | <!-- <a href="javascript:;" onclick="invitation_show('查看帖子','/admin/invitation/detail','','510')" class="btn btn-secondary radius">查看</a> --> | 68 | <!-- <a href="javascript:;" onclick="invitation_show('查看帖子','/admin/invitation/detail','','510')" class="btn btn-secondary radius">查看</a> --> |
| 68 | @if ($v->is_audit == 0) | 69 | @if ($v->is_audit == 0) |
| 69 | <a onClick="submitTiJiao({{$v->id}})" class="btn btn-secondary radius">审核通过</a> | 70 | <a onClick="submitTiJiao({{$v->id}})" class="btn btn-secondary radius">审核通过</a> |
| 70 | @else | 71 | @else |
| 71 | <a href="/" class="btn btn-default radius disabled">审核通过</a> | 72 | <a href="/" class="btn btn-default radius disabled">审核通过</a> |
| 72 | @endif | 73 | @endif |
| 73 | - | 74 | + |
| 74 | @if ($v->is_audit == 0) | 75 | @if ($v->is_audit == 0) |
| 75 | <a href="javascript:;" onclick="invitation_show('查看帖子','<?php echo '/admin/invitation/dels/'.$v->id ?>','','1000')" class="btn btn-danger radius">审核不通过</a> | 76 | <a href="javascript:;" onclick="invitation_show('查看帖子','<?php echo '/admin/invitation/dels/'.$v->id ?>','','1000')" class="btn btn-danger radius">审核不通过</a> |
| 76 | @else | 77 | @else |
| 77 | <a href="/" class="btn btn-default radius disabled">审核不通过</a> | 78 | <a href="/" class="btn btn-default radius disabled">审核不通过</a> |
| 78 | @endif | 79 | @endif |
| 80 | + | ||
| 81 | + @if ($v->is_audit == 1) | ||
| 82 | + <a onClick="submitDel({{$v->id}})" class="btn btn-danger radius">删除</a> | ||
| 83 | + @else | ||
| 84 | + @endif | ||
| 79 | </td> | 85 | </td> |
| 80 | </tr> | 86 | </tr> |
| 81 | <?php $n++; ?> | 87 | <?php $n++; ?> |
| @@ -109,6 +115,10 @@ function member_add(title,url,w,h){ | @@ -109,6 +115,10 @@ function member_add(title,url,w,h){ | ||
| 109 | function invitation_show(title,url,id,w,h){ | 115 | function invitation_show(title,url,id,w,h){ |
| 110 | layer_show(title,url,w,h); | 116 | layer_show(title,url,w,h); |
| 111 | } | 117 | } |
| 118 | +/*帖子-查看详情*/ | ||
| 119 | +function ini_show(title,url,id,w,h){ | ||
| 120 | + layer_show(title,url,w,h); | ||
| 121 | +} | ||
| 112 | 122 | ||
| 113 | function submitTiJiao(id) { | 123 | function submitTiJiao(id) { |
| 114 | 124 | ||
| @@ -140,6 +150,37 @@ function submitTiJiao(id) { | @@ -140,6 +150,37 @@ function submitTiJiao(id) { | ||
| 140 | 150 | ||
| 141 | }); | 151 | }); |
| 142 | } | 152 | } |
| 153 | + | ||
| 154 | +function submitDel(id) { | ||
| 155 | + | ||
| 156 | + //ajax提交 | ||
| 157 | + $.ajax({ | ||
| 158 | + type: 'get', | ||
| 159 | + url: '{{url("admin/invitation/delete/")}}'+'/'+id, | ||
| 160 | + dataType: 'json', | ||
| 161 | + success:function(msg){ | ||
| 162 | + //msg服务器返回json格式数据 | ||
| 163 | + if(msg.info == 1){ | ||
| 164 | + // $("#modal-demo").modal("show") | ||
| 165 | + $("body").Huimodalalert({ | ||
| 166 | + content: '删除成功', | ||
| 167 | + speed: 300 | ||
| 168 | + }) | ||
| 169 | + | ||
| 170 | + setTimeout (function(){ | ||
| 171 | + //插入成功 | ||
| 172 | + parent.window.location.href = parent.window.location.href; | ||
| 173 | + layer_close(); | ||
| 174 | + },800); | ||
| 175 | + } | ||
| 176 | + else{ | ||
| 177 | + //插入失败 | ||
| 178 | + layer.msg('删除失败'+msg.error,{icon:5,time:2000}); | ||
| 179 | + } | ||
| 180 | + } | ||
| 181 | + | ||
| 182 | + }); | ||
| 183 | +} | ||
| 143 | </script> | 184 | </script> |
| 144 | <!--/请在上方写此页面业务相关的脚本--> | 185 | <!--/请在上方写此页面业务相关的脚本--> |
| 145 | </body> | 186 | </body> |
| @@ -40,11 +40,12 @@ Route::get('/admin/tag/del/{id}','Admin\[email protected]'); | @@ -40,11 +40,12 @@ Route::get('/admin/tag/del/{id}','Admin\[email protected]'); | ||
| 40 | // 显示帖子列表 | 40 | // 显示帖子列表 |
| 41 | Route::get('admin/invitation/invitation','Admin\[email protected]'); | 41 | Route::get('admin/invitation/invitation','Admin\[email protected]'); |
| 42 | // 显示帖子详情 | 42 | // 显示帖子详情 |
| 43 | -Route::get('admin/invitation/detail','Admin\[email protected]'); | 43 | +Route::get('admin/invitation/detail/{id}','Admin\[email protected]'); |
| 44 | // 删除指定帖子页面 | 44 | // 删除指定帖子页面 |
| 45 | Route::get('admin/invitation/dels/{id}','Admin\[email protected]'); | 45 | Route::get('admin/invitation/dels/{id}','Admin\[email protected]'); |
| 46 | // 删除指定帖子 | 46 | // 删除指定帖子 |
| 47 | Route::post('admin/invitation/del','Admin\[email protected]'); | 47 | Route::post('admin/invitation/del','Admin\[email protected]'); |
| 48 | +Route::get('admin/invitation/delete/{id}','Admin\[email protected]'); | ||
| 48 | // 审核指定帖子 | 49 | // 审核指定帖子 |
| 49 | Route::get('admin/invitation/check/{id}','Admin\[email protected]'); | 50 | Route::get('admin/invitation/check/{id}','Admin\[email protected]'); |
| 50 | 51 |
-
请 注册 或 登录 后发表评论