ZLW-PC\Administrator
7 years ago
21 changed files with 641 additions and 88 deletions
-
21app/Http/Controllers/Admin/ArticleController.php
-
69app/Http/Controllers/Admin/UserController.php
-
92app/Http/Controllers/Admin/UserRankController.php
-
16app/Http/Controllers/Admin/UserWithdrawController.php
-
63app/Http/Controllers/Home/IndexController.php
-
2app/Http/Controllers/Weixin/WxPayController.php
-
8public/css/style.css
-
BINpublic/images/logo.png
-
BINpublic/images/logo2.png
-
2resources/views/admin/UserWithdraw/index.blade.php
-
31resources/views/admin/user/edit.blade.php
-
4resources/views/admin/user/index.blade.php
-
54resources/views/admin/user/manualRecharge.blade.php
-
119resources/views/admin/userrank/add.blade.php
-
119resources/views/admin/userrank/edit.blade.php
-
26resources/views/admin/userrank/index.blade.php
-
19resources/views/home/common/header.blade.php
-
13resources/views/home/index/arclist.blade.php
-
8resources/views/home/index/goodslist.blade.php
-
52resources/views/home/index/index.blade.php
-
11routes/web.php
@ -0,0 +1,92 @@ |
|||
<?php |
|||
namespace App\Http\Controllers\Admin; |
|||
|
|||
use App\Http\Controllers\Admin\CommonController; |
|||
use DB; |
|||
use App\Http\Model\UserRank; |
|||
use App\Common\Helper; |
|||
|
|||
class UserRankController extends CommonController |
|||
{ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
} |
|||
|
|||
public function index() |
|||
{ |
|||
$data['posts'] = parent::pageList('user_rank', '', [['listorder', 'asc']]); |
|||
|
|||
if($data['posts']) |
|||
{ |
|||
foreach($data['posts'] as $k=>$v) |
|||
{ |
|||
|
|||
} |
|||
} |
|||
|
|||
return view('admin.userrank.index', $data); |
|||
} |
|||
|
|||
public function add() |
|||
{ |
|||
if(Helper::isPostRequest()) |
|||
{ |
|||
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);} |
|||
unset($_POST["_token"]); |
|||
|
|||
if(DB::table('user_rank')->insert(array_filter($_POST))) |
|||
{ |
|||
success_jump('添加成功!', route('admin_slide')); |
|||
} |
|||
else |
|||
{ |
|||
error_jump('添加失败!请修改后重新添加'); |
|||
} |
|||
} |
|||
|
|||
return view('admin.userrank.add'); |
|||
} |
|||
|
|||
public function edit() |
|||
{ |
|||
if(Helper::isPostRequest()) |
|||
{ |
|||
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else{$id="";exit;} |
|||
|
|||
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);} |
|||
unset($_POST["_token"]); |
|||
|
|||
if(DB::table('user_rank')->where('id', $id)->update($_POST)) |
|||
{ |
|||
success_jump('修改成功!', route('admin_slide')); |
|||
} |
|||
else |
|||
{ |
|||
error_jump('修改失败!'); |
|||
} |
|||
} |
|||
|
|||
if(!empty($_GET["id"])){$id = $_GET["id"];}else{$id="";} |
|||
if(preg_match('/[0-9]*/',$id)){}else{exit;} |
|||
|
|||
$data['id'] = $id; |
|||
$data['post'] = object_to_array(DB::table('user_rank')->where('id', $id)->first(), 1); |
|||
|
|||
return view('admin.userrank.edit', $data); |
|||
} |
|||
|
|||
public function del() |
|||
{ |
|||
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');} |
|||
|
|||
if(DB::table('user_rank')->whereIn("id", explode(',', $id))->delete()) |
|||
{ |
|||
success_jump('删除成功'); |
|||
} |
|||
else |
|||
{ |
|||
error_jump('删除失败!请重新提交'); |
|||
} |
|||
} |
|||
} |
Binary file not shown.
Before Width: 80 | Height: 80 | Size: 3.0 KiB After Width: 150 | Height: 80 | Size: 3.1 KiB |
Binary file not shown.
After Width: 150 | Height: 80 | Size: 2.8 KiB |
@ -0,0 +1,54 @@ |
|||
@extends('admin.layouts.app') |
|||
@section('title', '人工充值') |
|||
|
|||
@section('content') |
|||
<h2 class="sub-header">人工充值</h2> |
|||
|
|||
<form id="addarc" method="post" action="" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }} |
|||
<table class="table table-striped table-bordered"> |
|||
<tbody> |
|||
<tr> |
|||
<td colspan="2">当前充值用户:<?php if($user['user_name']){echo $user['user_name'];}else{echo $user['mobile'];} ?>,账户余额<font color="red"><?php echo $user['money']; ?></font>元</td>
|
|||
</tr> |
|||
<tr> |
|||
<td colspan="2">说明:正数为增加,负数为扣除</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right" width="150px">充值金额:</td> |
|||
<td> |
|||
<input name="money" class="required" type="text" id="money" value="" /><input name="id" type="hidden" value="<?php echo $user['id']; ?>" /> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button> <button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button></td> |
|||
</tr> |
|||
</tbody></table></form><!-- 表单结束 --> |
|||
<script> |
|||
$(function(){ |
|||
$(".required").blur(function(){ |
|||
var $parent = $(this).parent(); |
|||
$parent.find(".formtips").remove(); |
|||
if(this.value=="") |
|||
{ |
|||
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>'); |
|||
} |
|||
else |
|||
{ |
|||
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>'); |
|||
} |
|||
}); |
|||
|
|||
//重置
|
|||
$('#addarc input[type="reset"]').click(function(){ |
|||
$(".formtips").remove(); |
|||
}); |
|||
|
|||
$("#addarc").submit(function(){ |
|||
$(".required").trigger('blur'); |
|||
var numError = $('#addarc .onError').length; |
|||
|
|||
if(numError){return false;} |
|||
}); |
|||
}); |
|||
</script> |
|||
@endsection |
@ -0,0 +1,119 @@ |
|||
@extends('admin.layouts.app') |
|||
@section('title', '轮播图添加') |
|||
|
|||
@section('content') |
|||
<h5 class="sub-header"><a href="/fladmin/slide">轮播图列表</a> > 添加轮播图</h5> |
|||
|
|||
<form id="addarc" method="post" action="/fladmin/slide/doadd" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }} |
|||
<table class="table table-striped table-bordered"> |
|||
<tbody> |
|||
<tr> |
|||
<td align="right">标题:</td> |
|||
<td><input name="title" type="text" id="title" value="" class="required" style="width:30%" placeholder="在此输入关键词"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">链接网址:</td> |
|||
<td><input name="url" type="text" id="url" value="http://" style="width:60%" class="required"> (请用绝对地址)</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">跳转方式:</td> |
|||
<td> |
|||
<input type="radio" value='0' name="target" checked /> _blank |
|||
<input type="radio" value='1' name="target" /> _self |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">显示平台:</td> |
|||
<td> |
|||
<input type="radio" value='0' name="type" checked /> pc |
|||
<input type="radio" value='1' name="type" /> weixin |
|||
<input type="radio" value='2' name="type" /> app |
|||
<input type="radio" value='3' name="type" /> wap |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">是否显示:</td> |
|||
<td> |
|||
<input type="radio" value='0' name="is_show" checked /> 是 |
|||
<input type="radio" value='1' name="is_show" /> 否 |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">排序:</td> |
|||
<td> |
|||
<input name="listorder" type="text" id="listorder" value="50" size="3" /> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">所属的组:</td> |
|||
<td> |
|||
<input name="group_id" type="text" id="group_id" value="0" size="3" /> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="vertical-align:middle;" align="right">图片:</td> |
|||
<td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input class="required" name="pic" type="text" id="pic" value="" style="width:40%"> <img style="margin-left:20px;display:none;" src="" width="120" height="80" id="picview"></td> |
|||
</tr> |
|||
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script> |
|||
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script> |
|||
<script type="text/javascript"> |
|||
var _editor; |
|||
$(function() { |
|||
//重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
|
|||
_editor = UE.getEditor('ueditorimg'); |
|||
_editor.ready(function () { |
|||
//设置编辑器不可用
|
|||
_editor.setDisabled('insertimage'); |
|||
//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
|
|||
_editor.hide(); |
|||
//侦听图片上传
|
|||
_editor.addListener('beforeInsertImage', function (t, arg) { |
|||
//将地址赋值给相应的input,只取第一张图片的路径
|
|||
$('#pic').val(arg[0].src); |
|||
//图片预览
|
|||
$('#picview').attr("src",arg[0].src).css("display","inline-block"); |
|||
}) |
|||
}); |
|||
}); |
|||
//弹出图片上传的对话框
|
|||
function upImage() |
|||
{ |
|||
var myImage = _editor.getDialog("insertimage"); |
|||
myImage.render(); |
|||
myImage.open(); |
|||
} |
|||
</script> |
|||
<script type="text/plain" id="ueditorimg"></script> |
|||
<tr> |
|||
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button> <button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button></td> |
|||
</tr> |
|||
</tbody></table></form><!-- 表单结束 --> |
|||
<script> |
|||
$(function(){ |
|||
$(".required").blur(function(){ |
|||
var $parent = $(this).parent(); |
|||
$parent.find(".formtips").remove(); |
|||
if(this.value=="") |
|||
{ |
|||
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>'); |
|||
} |
|||
else |
|||
{ |
|||
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>'); |
|||
} |
|||
}); |
|||
|
|||
//重置
|
|||
$('#addarc input[type="reset"]').click(function(){ |
|||
$(".formtips").remove(); |
|||
}); |
|||
|
|||
$("#addarc").submit(function(){ |
|||
$(".required").trigger('blur'); |
|||
var numError = $('#addarc .onError').length; |
|||
|
|||
if(numError){return false;} |
|||
}); |
|||
}); |
|||
</script> |
|||
@endsection |
@ -0,0 +1,119 @@ |
|||
@extends('admin.layouts.app') |
|||
@section('title', '轮播图修改') |
|||
|
|||
@section('content') |
|||
<h5 class="sub-header"><a href="/fladmin/slide">轮播图列表</a> > 轮播图修改</h5> |
|||
|
|||
<form id="addarc" method="post" action="/fladmin/slide/doedit" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }} |
|||
<table class="table table-striped table-bordered"> |
|||
<tbody> |
|||
<tr> |
|||
<td align="right">标题:</td> |
|||
<td><input name="title" type="text" id="title" value="<?php echo $post['title']; ?>" class="required" style="width:30%" placeholder="在此输入关键词"><input style="display:none;" name="id" type="text" id="id" value="<?php echo $id; ?>"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">链接网址:</td> |
|||
<td><input name="url" type="text" id="url" value="<?php echo $post['url']; ?>" style="width:60%" class="required"> (请用绝对地址)</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">跳转方式:</td> |
|||
<td> |
|||
<input type="radio" value='0' name="target" <?php if(isset($post['target']) && $post['target']==0){echo 'checked';} ?> /> _blank
|
|||
<input type="radio" value='1' name="target" <?php if(isset($post['target']) && $post['target']==1){echo 'checked';} ?> /> _self
|
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">显示平台:</td> |
|||
<td> |
|||
<input type="radio" value='0' name="type" <?php if(isset($post['type']) && $post['type']==0){echo 'checked';} ?> /> pc
|
|||
<input type="radio" value='1' name="type" <?php if(isset($post['type']) && $post['type']==1){echo 'checked';} ?> /> weixin
|
|||
<input type="radio" value='2' name="type" <?php if(isset($post['type']) && $post['type']==2){echo 'checked';} ?> /> app
|
|||
<input type="radio" value='3' name="type" <?php if(isset($post['type']) && $post['type']==3){echo 'checked';} ?> /> wap
|
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">是否显示:</td> |
|||
<td> |
|||
<input type="radio" value='0' name="is_show" <?php if(isset($post['is_show']) && $post['is_show']==0){echo 'checked';} ?> /> 是
|
|||
<input type="radio" value='1' name="is_show" <?php if(isset($post['is_show']) && $post['is_show']==1){echo 'checked';} ?> /> 否
|
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">排序:</td> |
|||
<td> |
|||
<input name="listorder" type="text" id="listorder" value="<?php echo $post['listorder']; ?>" size="3" /> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">所属的组:</td> |
|||
<td> |
|||
<input name="group_id" type="text" id="group_id" value="<?php echo $post['group_id']; ?>" size="3" /> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="vertical-align:middle;" align="right">图片:</td> |
|||
<td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input name="pic" type="text" id="pic" value="<?php echo $post['pic']; ?>" style="width:40%"> <img style="margin-left:20px;<?php if(empty($post["pic"]) || !imgmatch($post["pic"])){ echo "display:none;"; } ?>" src="<?php if(imgmatch($post["pic"])){echo $post["pic"];} ?>" width="120" height="80" id="picview"></td> |
|||
</tr> |
|||
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script> |
|||
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script> |
|||
<script type="text/javascript"> |
|||
var _editor; |
|||
$(function() { |
|||
//重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
|
|||
_editor = UE.getEditor('ueditorimg'); |
|||
_editor.ready(function () { |
|||
//设置编辑器不可用
|
|||
_editor.setDisabled('insertimage'); |
|||
//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
|
|||
_editor.hide(); |
|||
//侦听图片上传
|
|||
_editor.addListener('beforeInsertImage', function (t, arg) { |
|||
//将地址赋值给相应的input,只取第一张图片的路径
|
|||
$('#pic').val(arg[0].src); |
|||
//图片预览
|
|||
$('#picview').attr("src",arg[0].src).css("display","inline-block"); |
|||
}) |
|||
}); |
|||
}); |
|||
//弹出图片上传的对话框
|
|||
function upImage() |
|||
{ |
|||
var myImage = _editor.getDialog("insertimage"); |
|||
myImage.render(); |
|||
myImage.open(); |
|||
} |
|||
</script> |
|||
<script type="text/plain" id="ueditorimg"></script> |
|||
<tr> |
|||
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button> <button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button></td> |
|||
</tr> |
|||
</tbody></table></form><!-- 表单结束 --> |
|||
<script> |
|||
$(function(){ |
|||
$(".required").blur(function(){ |
|||
var $parent = $(this).parent(); |
|||
$parent.find(".formtips").remove(); |
|||
if(this.value=="") |
|||
{ |
|||
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>'); |
|||
} |
|||
else |
|||
{ |
|||
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>'); |
|||
} |
|||
}); |
|||
|
|||
//重置
|
|||
$('#addarc input[type="reset"]').click(function(){ |
|||
$(".formtips").remove(); |
|||
}); |
|||
|
|||
$("#addarc").submit(function(){ |
|||
$(".required").trigger('blur'); |
|||
var numError = $('#addarc .onError').length; |
|||
|
|||
if(numError){return false;} |
|||
}); |
|||
}); |
|||
</script> |
|||
@endsection |
@ -0,0 +1,26 @@ |
|||
@extends('admin.layouts.app') |
|||
@section('title', '会员等级列表') |
|||
|
|||
@section('content') |
|||
<h2 class="sub-header">会员等级管理</h2>[ <a href="<?php echo route('admin_userrank_add'); ?>">添加会员等级</a> ]<br><br> |
|||
|
|||
<form name="listarc"><div class="table-responsive"><table class="table table-hover"> |
|||
<thead><tr class="info"> |
|||
<th>ID</th> |
|||
<th>等级名称</th> |
|||
<th>等级</th> |
|||
<th>排序</th> |
|||
<th>管理</th> |
|||
</tr></thead> |
|||
<tbody> |
|||
<?php if($posts){foreach($posts as $row){ ?><tr>
|
|||
<td><?php echo $row->id; ?></td>
|
|||
<td><?php echo $row->title; ?></td>
|
|||
<td><?php echo $row->rank; ?></td>
|
|||
<td><?php echo $row->listorder; ?></td>
|
|||
<td><a href="<?php echo route('admin_userrank_edit',array('id'=>$row->id)); ?>">修改</a> | <a onclick="delconfirm('<?php echo route('admin_userrank_del',array('id'=>$row->id)); ?>')" href="javascript:;">删除</a></td> |
|||
</tr><?php }} ?>
|
|||
</tbody></table></div><!-- 表格结束 --></form><!-- 表单结束 --> |
|||
|
|||
<nav aria-label="Page navigation">{{ $posts->links() }}</nav> |
|||
@endsection |
@ -0,0 +1,13 @@ |
|||
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> |
|||
<title><?php if($post){echo $post["name"].'_'.sysconfig('CMS_WEBNAME');}else{echo '动态';} ?></title><meta name="keywords" content="{dede:field.keywords/}" /><meta name="description" content="{dede:field.description function='html2text(@me)'/}" /><link rel="stylesheet" href="<?php echo sysconfig('CMS_BASEHOST'); ?>/css/style.css"><script type="text/javascript" src="<?php echo sysconfig('CMS_BASEHOST'); ?>/js/ad.js"></script></head><body>
|
|||
@include('home.common.header') |
|||
|
|||
<div class="box" style="padding-top:20px;"> |
|||
<?php if(!empty($posts)){foreach($posts as $row){ ?><div class="list"><?php if(!empty($row['litpic'])){ ?><a class="limg" href="<?php echo get_front_url(array("id"=>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><img alt="<?php echo $row['title']; ?>" src="<?php echo $row['litpic']; ?>"></a><?php } ?>
|
|||
<strong class="tit"><a href="<?php echo get_front_url(array("id"=>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?></a></strong><p><?php echo mb_strcut($row['description'],0,150,'UTF-8'); ?>..</p>
|
|||
<div class="info"><span class="fl"><?php $taglist=taglist($row['id']);if($taglist){foreach($taglist as $row){ ?><a href="<?php echo get_front_url(array("tagid"=>$row['id'],"type"=>'tags')); ?>"><?php echo $row['tag']; ?></a><?php }} ?><em><?php echo date("m-d H:i",$row['pubdate']); ?></em></span><span class="fr"><em><?php echo $row['click']; ?></em>人阅读</span></div><div class="cl"></div></div><?php }} ?>
|
|||
</div> |
|||
|
|||
<?php if($pagenav){ ?><div class="pages"><ul><li style="width:180px;"><a href="<?php echo $pagenav; ?>">获取更多</a></li></ul><div class="cl"></div></div><?php } ?>
|
|||
|
|||
@include('home.common.footer')</body></html> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue