Browse Source

order detail

master
ZLW-PC\Administrator 7 years ago
parent
commit
e15e369860
  1. 113
      app/Http/Controllers/Admin/AdminController.php
  2. 26
      app/Http/Controllers/Admin/AdminRoleController.php
  3. 2
      app/Http/Controllers/Admin/GoodsController.php
  4. 10
      app/Http/Controllers/Admin/LoginController.php
  5. 60
      app/Http/Controllers/Admin/OrderController.php
  6. 51
      app/Http/Controllers/Admin/UserController.php
  7. 50
      app/Http/Model/Order.php
  8. 24
      app/Http/Model/OrderGoods.php
  9. 64
      resources/views/admin/admin/add.blade.php
  10. 67
      resources/views/admin/admin/edit.blade.php
  11. 58
      resources/views/admin/admin/edit222.blade.php
  12. 26
      resources/views/admin/admin/index.blade.php
  13. 0
      resources/views/admin/admin/register.blade.php
  14. 4
      resources/views/admin/adminrole/add.blade.php
  15. 4
      resources/views/admin/adminrole/edit.blade.php
  16. 4
      resources/views/admin/adminrole/index.blade.php
  17. 4
      resources/views/admin/adminrole/permissions.blade.php
  18. 138
      resources/views/admin/order/detail.blade.php
  19. 60
      resources/views/admin/order/index.blade.php
  20. 4
      resources/views/admin/user/add.blade.php
  21. 4
      resources/views/admin/user/edit.blade.php
  22. 4
      resources/views/admin/user/index.blade.php
  23. 26
      routes/web.php

113
app/Http/Controllers/Admin/AdminController.php

@ -0,0 +1,113 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
class AdminController extends CommonController
{
public function __construct()
{
parent::__construct();
}
public function index()
{
$posts = parent::pageList('admin');
$data['posts'] = $posts;
return view('admin.admin.index', $data);
}
public function add()
{
$data['rolelist'] = object_to_array(DB::table('admin_role')->orderBy('listorder','desc')->get());
return view('admin.admin.add', $data);
}
public function doadd()
{
unset($_POST["_token"]);
$_POST['pwd'] = md5($_POST['pwd']);
if(DB::table('admin')->insert($_POST))
{
success_jump('添加成功!', route('admin_admin'));
}
else
{
error_jump('添加失败!请修改后重新添加');
}
}
public function edit()
{
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('admin')->where('id', $id)->first(), 1);
$data['rolelist'] = object_to_array(DB::table('admin_role')->orderBy('listorder','desc')->get());
return view('admin.admin.edit', $data);
}
public function doedit()
{
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else {$id="";exit;}
unset($_POST["_token"]);
$_POST['pwd'] = md5($_POST['pwd']);
if(DB::table('admin')->where('id', $id)->update($_POST))
{
success_jump('修改成功!', route('admin_admin'));
}
else
{
error_jump('修改失败!');
}
}
//修改密码
/* public function doedit()
{
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else {$id="";exit;}
unset($_POST["_token"]);
if(!empty($_POST["username"])){$data['username'] = $map['username'] = $_POST["username"];}else{error_jump('用户名不能为空');exit;}//用户名
if(!empty($_POST["oldpwd"])){$map['pwd'] = md5($_POST["oldpwd"]);}else{error_jump('旧密码错误');exit;}
if($_POST["newpwd"]==$_POST["newpwd2"]){$data['pwd'] = md5($_POST["newpwd"]);}else{error_jump('密码错误');exit;}
if($_POST["oldpwd"]==$_POST["newpwd"]){error_jump('新旧密码不能一致!');exit;}
$User = object_to_array(DB::table("admin")->where($map)->first(), 1);
if($User)
{
if(DB::table('admin')->where('id', $id)->update($data))
{
session_unset();
session_destroy();
success_jump('修改成功,请重新登录', route('admin_login'), 3);
}
}
else
{
error_jump('修改失败!旧用户名或密码错误');
}
} */
public function del()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');}
if(DB::table('admin')->whereIn("id", explode(',', $id))->delete())
{
success_jump('删除成功');
}
else
{
error_jump('删除失败!请重新提交');
}
}
}

26
app/Http/Controllers/Admin/UserRoleController.php → app/Http/Controllers/Admin/AdminRoleController.php

@ -4,7 +4,7 @@ namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
class UserRoleController extends CommonController
class AdminRoleController extends CommonController
{
public function __construct()
{
@ -13,24 +13,24 @@ class UserRoleController extends CommonController
public function index()
{
$posts = parent::pageList('admin_user_role', '', ['listorder','desc']);
$posts = parent::pageList('admin_role', '', ['listorder','desc']);
$data['posts'] = $posts;
return view('admin.userrole.index', $data);
return view('admin.adminrole.index', $data);
}
public function add()
{
return view('admin.userrole.add');
return view('admin.adminrole.add');
}
public function doadd()
{
unset($_POST["_token"]);
if(DB::table('admin_user_role')->insert($_POST))
if(DB::table('admin_role')->insert($_POST))
{
success_jump('添加成功!', route('admin_userrole'));
success_jump('添加成功!', route('admin_adminrole'));
}
else
{
@ -44,9 +44,9 @@ class UserRoleController extends CommonController
if(preg_match('/[0-9]*/',$id)){}else{exit;}
$data['id'] = $id;
$data['post'] = object_to_array(DB::table('admin_user_role')->where('id', $id)->first(), 1);
$data['post'] = object_to_array(DB::table('admin_role')->where('id', $id)->first(), 1);
return view('admin.userrole.edit', $data);
return view('admin.adminrole.edit', $data);
}
public function doedit()
@ -54,9 +54,9 @@ class UserRoleController extends CommonController
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else {$id="";exit;}
unset($_POST["_token"]);
if(DB::table('admin_user_role')->where('id', $id)->update($_POST))
if(DB::table('admin_role')->where('id', $id)->update($_POST))
{
success_jump('修改成功!', route('admin_userrole'));
success_jump('修改成功!', route('admin_adminrole'));
}
else
{
@ -68,7 +68,7 @@ class UserRoleController extends CommonController
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');}
if(DB::table('admin_user_role')->whereIn("id", explode(',', $id))->delete())
if(DB::table('admin_role')->whereIn("id", explode(',', $id))->delete())
{
success_jump('删除成功');
}
@ -104,7 +104,7 @@ class UserRoleController extends CommonController
}
}
return view('admin.userrole.permissions', $data);
return view('admin.adminrole.permissions', $data);
}
//角色权限设置
@ -139,4 +139,4 @@ class UserRoleController extends CommonController
error_jump('操作失败!');
}
}
}
}

2
app/Http/Controllers/Admin/GoodsController.php

@ -153,7 +153,7 @@ class GoodsController extends CommonController
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');}
if(DB::table('goods')->whereIn("id", explode(',', $id))->delete())
if(DB::table('goods')->whereIn("id", explode(',', $id))->update(['status' => 1]))
{
success_jump("$id ,删除成功");
}

10
app/Http/Controllers/Admin/LoginController.php

@ -36,16 +36,16 @@ class LoginController extends BaseController
if(!empty($_POST["username"])){$username = $_POST["username"];}else{$username='';exit;}//用户名
if(!empty($_POST["pwd"])){$pwd = md5($_POST["pwd"]);}else{$pwd='';exit;}//密码
$admin_user = DB::table('admin_user')->where(array('username' => $username, 'pwd' => $pwd))->orWhere(array('email' => $username, 'pwd' => $pwd))->first();
$admin_user = DB::table('admin')->where(array('username' => $username, 'pwd' => $pwd))->orWhere(array('email' => $username, 'pwd' => $pwd))->first();
if($admin_user)
{
$admin_user_info = object_to_array($admin_user, 1);
$admin_user_info['rolename'] = DB::table('admin_user_role')->where(array('id'=>$admin_user->role_id))->value('name');
$admin_user_info['rolename'] = DB::table('admin_role')->where(array('id'=>$admin_user->role_id))->value('name');
$_SESSION['admin_user_info'] = $admin_user_info;
DB::table('admin_user')->where(array('id'=>$admin_user->role_id))->update(array('logintime' => time()));
DB::table('admin')->where(array('id'=>$admin_user->role_id))->update(array('logintime' => time()));
return redirect()->route('admin');
}
@ -69,7 +69,7 @@ class LoginController extends BaseController
$data["username"] = "admin888";
$data["pwd"] = "21232f297a57a5a743894a0e4a801fc3";
if(DB::table('admin_user')->where('id', 1)->update($data))
if(DB::table('admin')->where('id', 1)->update($data))
{
success_jump('密码恢复成功!', route('admin_login'));
}
@ -94,7 +94,7 @@ class LoginController extends BaseController
return 0;
}
return DB::table("admin_user")->where($map)->count();
return DB::table("admin")->where($map)->count();
}
//测试

60
app/Http/Controllers/Admin/OrderController.php

@ -3,6 +3,9 @@ namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use App\Http\Model\Order;
use App\Http\Model\OrderGoods;
use App\Http\Model\User;
use App\Http\Model\Region;
use DB;
class OrderController extends CommonController
@ -18,9 +21,24 @@ class OrderController extends CommonController
$where = function ($query) use ($res) {
if(isset($_REQUEST["keyword"]))
{
$query->where('order_sn', 'like', '%'.$_REQUEST['keyword'].'%')->orWhere("name", "like", '%'.$_REQUEST['keyword'].'%');
$query->where('order_sn', 'like', '%'.$_REQUEST['keyword'].'%')->orWhere("name", "like", '%'.$_REQUEST['keyword'].'%')->orWhere("mobile", "like", '%'.$_REQUEST['keyword'].'%');
}
if(isset($_REQUEST["mobile"]))
{
$query->where('mobile', 'like', '%'.$_REQUEST['mobile'].'%');
}
if(isset($_REQUEST["order_sn"]))
{
$query->where('order_sn', 'like', '%'.$_REQUEST['order_sn'].'%');
}
if(isset($_REQUEST["name"]))
{
$query->where("name", "like", '%'.$_REQUEST['name'].'%');
}
//0或者不传表示全部,1待付款,2待发货,3待收货,4待评价(确认收货,交易成功),5退款/售后
if(isset($_REQUEST["status"]))
{
@ -55,6 +73,10 @@ class OrderController extends CommonController
$order_status_arr = Order::getOrderStatusText(object_to_array($value, 1));
$posts[$key]->order_status_text = $order_status_arr?$order_status_arr['text']:'';
$posts[$key]->order_status_num = $order_status_arr?$order_status_arr['num']:'';
$posts[$key]->province_name = Region::getRegionName($value->province);
$posts[$key]->city_name = Region::getRegionName($value->city);
$posts[$key]->district_name = Region::getRegionName($value->district);
}
$data['posts'] = $posts;
@ -62,6 +84,42 @@ class OrderController extends CommonController
return view('admin.order.index', $data);
}
public function detail()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{$id="";}
if(preg_match('/[0-9]*/',$id)){}else{exit;}
$data['id'] = $id;
$data['post'] = Order::where('id', $id)->first();
if($data['post'])
{
$order_status_arr = Order::getOrderStatusText($data['post']);
$data['post']['order_status_text'] = $order_status_arr?$order_status_arr['text']:'';
$data['post']['order_status_num'] = $order_status_arr?$order_status_arr['num']:'';
$data['post']['province_name'] = Region::getRegionName($data['post']['province']);
$data['post']['city_name'] = Region::getRegionName($data['post']['city']);
$data['post']['district_name'] = Region::getRegionName($data['post']['district']);
$data['post']['invoice_text'] = Order::getInvoiceText($data['post']);
$data['post']['place_type_text'] = Order::getPlaceTypeText($data['post']);
$data['post']['user'] = User::where(array('id'=>$data['post']['user_id']))->first(); //下单人信息
$order_goods = OrderGoods::where(array('order_id'=>$data['post']['id']))->get(); //订单商品列表
foreach($order_goods as $k=>$v)
{
$order_goods[$k]['refund_status_text'] = OrderGoods::getRefundStatusText($v);
}
$data['post']['goodslist'] = $order_goods;
}
//echo '<pre>';print_r($data['post']);exit;
return view('admin.order.detail', $data);
}
public function doadd()
{
$_POST['add_time'] = time();//更新时间

51
app/Http/Controllers/Admin/UserController.php

@ -13,7 +13,7 @@ class UserController extends CommonController
public function index()
{
$posts = parent::pageList('admin_user');
$posts = parent::pageList('user');
$data['posts'] = $posts;
@ -22,16 +22,13 @@ class UserController extends CommonController
public function add()
{
$data['rolelist'] = object_to_array(DB::table('admin_user_role')->orderBy('listorder','desc')->get());
return view('admin.user.add', $data);
return view('admin.user.add');
}
public function doadd()
{
unset($_POST["_token"]);
$_POST['pwd'] = md5($_POST['pwd']);
if(DB::table('admin_user')->insert($_POST))
if(DB::table('user')->insert($_POST))
{
success_jump('添加成功!', route('admin_user'));
}
@ -43,13 +40,12 @@ class UserController extends CommonController
public function edit()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{$id="";}
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('admin_user')->where('id', $id)->first(), 1);
$data['rolelist'] = object_to_array(DB::table('admin_user_role')->orderBy('listorder','desc')->get());
$data['post'] = object_to_array(DB::table('user')->where('id', $id)->first(), 1);
return view('admin.user.edit', $data);
}
@ -58,8 +54,7 @@ class UserController extends CommonController
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else {$id="";exit;}
unset($_POST["_token"]);
$_POST['pwd'] = md5($_POST['pwd']);
if(DB::table('admin_user')->where('id', $id)->update($_POST))
if(DB::table('user')->where('id', $id)->update($_POST))
{
success_jump('修改成功!', route('admin_user'));
}
@ -69,39 +64,11 @@ class UserController extends CommonController
}
}
//修改密码
/* public function doedit()
{
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else {$id="";exit;}
unset($_POST["_token"]);
if(!empty($_POST["username"])){$data['username'] = $map['username'] = $_POST["username"];}else{error_jump('用户名不能为空');exit;}//用户名
if(!empty($_POST["oldpwd"])){$map['pwd'] = md5($_POST["oldpwd"]);}else{error_jump('旧密码错误');exit;}
if($_POST["newpwd"]==$_POST["newpwd2"]){$data['pwd'] = md5($_POST["newpwd"]);}else{error_jump('密码错误');exit;}
if($_POST["oldpwd"]==$_POST["newpwd"]){error_jump('新旧密码不能一致!');exit;}
$User = object_to_array(DB::table("user")->where($map)->first(), 1);
if($User)
{
if(DB::table('user')->where('id', $id)->update($data))
{
session_unset();
session_destroy();
success_jump('修改成功,请重新登录', route('admin_login'), 3);
}
}
else
{
error_jump('修改失败!旧用户名或密码错误');
}
} */
public function del()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');}
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');}
if(DB::table('admin_user')->whereIn("id", explode(',', $id))->delete())
if(DB::table('user')->whereIn("id", explode(',', $id))->delete())
{
success_jump('删除成功');
}

50
app/Http/Model/Order.php

@ -24,7 +24,7 @@ class Order extends BaseModel
$limit = isset($limit) ? $limit : 10;
$offset = isset($offset) ? $offset : 0;
$where['user_id'] = $user_id;
if(isset($user_id)){$where['user_id'] = $user_id;}
$where['is_delete'] = 0;
//0或者不传表示全部,1待付款,2待发货,3待收货,4待评价(确认收货,交易成功),5退款/售后
@ -76,6 +76,10 @@ class Order extends BaseModel
$order_list[$k]['order_status_text'] = $order_status_arr?$order_status_arr['text']:'';
$order_list[$k]['order_status_num'] = $order_status_arr?$order_status_arr['num']:'';
$order_list[$k]['province_name'] = Region::getRegionName($v['province']);
$order_list[$k]['city_name'] = Region::getRegionName($v['city']);
$order_list[$k]['district_name'] = Region::getRegionName($v['district']);
$order_goods = OrderGoods::where(array('order_id'=>$v['id']))->get();
$order_list[$k]['goods_list'] = $order_goods;
}
@ -278,4 +282,48 @@ class Order extends BaseModel
return $res;
}
//获取发票类型文字:0不索要发票,1个人,2企业
public static function getInvoiceText($where)
{
$res = '';
if($where['invoice'] == 0)
{
$res = '不索要发票';
}
elseif($where['invoice'] == 1)
{
$res = '个人';
}
elseif($where['invoice'] == 2)
{
$res = '企业';
}
return $res;
}
//获取订单来源文字:1pc,2weixin,3app,4wap
public static function getPlaceTypeText($where)
{
$res = '';
if($where['place_type'] === 1)
{
$res = 'pc';
}
elseif($where['place_type'] === 2)
{
$res = 'weixin';
}
elseif($where['place_type'] === 3)
{
$res = 'app';
}
elseif($where['place_type'] === 4)
{
$res = 'wap';
}
return $res;
}
}

24
app/Http/Model/OrderGoods.php

@ -20,4 +20,28 @@ class OrderGoods extends BaseModel
* @var bool
*/
public $timestamps = false;
//获取退货状态文字:0无退货,1退款中,2退款成功,3不同意退款
public static function getRefundStatusText($where)
{
$res = '';
if($where['refund_status'] == 0)
{
$res = '无退货';
}
elseif($where['refund_status'] == 1)
{
$res = '退款中';
}
elseif($where['refund_status'] == 2)
{
$res = '退款成功';
}
elseif($where['refund_status'] == 3)
{
$res = '不同意退款';
}
return $res;
}
}

64
resources/views/admin/admin/add.blade.php

@ -0,0 +1,64 @@
@extends('admin.layouts.app')
@section('title', '管理员添加')
@section('content')
<h5 class="sub-header"><a href="<?php echo route('admin_admin'); ?>">管理员列表</a> > 管理员添加</h5>
<form id="addarc" method="post" action="<?php echo route('admin_admin_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="username" type="text" id="username" value="" class="required" style="width:30%" placeholder="在此输入用户名"></td>
</tr>
<tr>
<td align="right">密码:</td>
<td><input name="pwd" type="password" id="pwd" value="" class="required" style="width:60%"></td>
</tr>
<tr>
<td align="right">邮箱:</td>
<td><input name="email" type="text" id="email" value="" style="width:60%"></td>
</tr>
<tr>
<td align="right">角色:</td>
<td>
<select name="role_id" id="role_id">
<?php if($rolelist){foreach($rolelist as $row){ ?>
<option value="<?php echo $row["id"]; ?>"><?php echo $row["name"]; ?></option>
<?php }} ?>
</select>
</td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></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

67
resources/views/admin/admin/edit.blade.php

@ -0,0 +1,67 @@
@extends('admin.layouts.app')
@section('title', '管理员修改')
@section('content')
<h5 class="sub-header"><a href="<?php echo route('admin_admin'); ?>">管理员列表</a> > 管理员修改</h5>
<form id="addarc" method="post" action="<?php echo route('admin_admin_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="username" type="text" id="username" value="<?php echo $post["username"]; ?>" class="required" style="width:30%" placeholder="在此输入用户名"><input style="display:none;" type="text" name="id" id="id" value="<?php echo $id; ?>"></td>
</tr>
<tr>
<td align="right">密码:</td>
<td><input name="pwd" type="password" id="pwd" value="" class="required" style="width:30%"></td>
</tr>
<tr>
<td align="right">邮箱:</td>
<td><input name="email" type="text" id="email" value="<?php echo $post["email"]; ?>" style="width:30%"></td>
</tr>
<tr>
<td align="right">角色:</td>
<td>
<select name="role_id" id="role_id">
<?php if($rolelist){foreach($rolelist as $row){ ?>
<?php if($post["role_id"]==$row["id"]){ ?>
<option selected value="<?php echo $row["id"]; ?>"><?php echo $row["name"]; ?></option>
<?php }else{ ?>
<option value="<?php echo $row["id"]; ?>"><?php echo $row["name"]; ?></option>
<?php }}} ?>
</select>
</td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<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

58
resources/views/admin/admin/edit222.blade.php

@ -0,0 +1,58 @@
<!DOCTYPE html><html><head><title>密码修改_后台管理</title>@include('admin.common.header')
<div class="container-fluid">
<div class="row">
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 -->
<style>.input-error{background-color:#ffe7e7;}</style>
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox">
<h2 class="sub-header">密码修改</h2>
<form id="addarc" method="post" action="/fladmin/user/doedit" class="table-responsive" role="form">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right">用户名:</td>
<td><input name="username" type="text" class="" id="username" value="<?php echo $post["username"]; ?>" style="width:30%"></td>
</tr>
<tr>
<td align="right">旧密码:</td>
<td><input name="oldpwd" type="password" class="" id="oldpwd" value="" style="width:30%"></td>
</tr>
<tr>
<td align="right">新密码:</td>
<td><input name="newpwd" type="password" class="" id="newpwd" value="" style="width:30%"></td>
</tr>
<tr>
<td align="right">确认密码:</td>
<td><input name="newpwd2" type="password" class="" id="newpwd2" value="" style="width:30%"></td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></td>
</tr>
</tbody></table></form><!-- 表单结束 -->
</div></div><!-- 右边结束 --></div></div>
<script>
$('#addarc input[type="text"], #addarc input[type="password"]').on('focus', function() {
$(this).removeClass('input-error');
});
$('#addarc').on('submit', function(e) {
$(this).find('input[type="text"], input[type="password"]').each(function(){
if( $(this).val() == "" ) {
e.preventDefault();
$(this).addClass('input-error');
}
else {
$(this).removeClass('input-error');
}
});
if($('#newpwd').val()!=$('#newpwd2').val() || $('#newpwd').val()=='')
{
e.preventDefault();
$('#newpwd').addClass('input-error');
$('#newpwd2').addClass('input-error');
}
else {
$('#newpwd').removeClass('input-error');
$('#newpwd2').removeClass('input-error');
}
});
</script>
</body></html>

26
resources/views/admin/admin/index.blade.php

@ -0,0 +1,26 @@
@extends('admin.layouts.app')
@section('title', '管理员列表')
@section('content')
<h2 class="sub-header">管理员列表</h2>[ <a href="<?php echo route('admin_admin_add'); ?>">添加管理员</a> ]<br><br>
<form name="listarc"><div class="table-responsive"><table class="table table-striped table-hover">
<thead><tr>
<th>ID</th>
<th>用户名</th>
<th>邮箱</th>
<th>状态</th>
<th>管理</th>
</tr></thead>
<tbody>
<?php foreach($posts as $row){ ?><tr>
<td><?php echo $row->id; ?></td>
<td><?php echo $row->username; ?></td>
<td><?php echo $row->email; ?></td>
<td><?php if($row->status==0){echo '正常';}elseif($row->status==1){echo '禁用';}elseif($row->status==2){echo '禁用';} ?></td>
<td><a href="<?php echo route('admin_admin_edit'); ?>?id=<?php echo $row->id; ?>">修改</a><?php if($row->id<>1){ ?> | <a onclick="delconfirm('<?php echo route('admin_admin_del'); ?>?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a><?php } ?></td>
</tr><?php } ?>
</tbody></table></div><!-- 表格结束 --></form><!-- 表单结束 -->
<nav aria-label="Page navigation">{{ $posts->links() }}</nav>
@endsection

0
resources/views/admin/user/register.blade.php → resources/views/admin/admin/register.blade.php

4
resources/views/admin/userrole/add.blade.php → resources/views/admin/adminrole/add.blade.php

@ -2,9 +2,9 @@
@section('title', '添加角色')
@section('content')
<h5 class="sub-header"><a href="/fladmin/userrole">角色列表</a> > 添加角色</h5>
<h5 class="sub-header"><a href="<?php echo route('admin_adminrole'); ?>">角色列表</a> > 添加角色</h5>
<form id="addarc" method="post" action="/fladmin/userrole/doadd" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<form id="addarc" method="post" action="<?php echo route('admin_adminrole_doadd'); ?>" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>

4
resources/views/admin/userrole/edit.blade.php → resources/views/admin/adminrole/edit.blade.php

@ -2,9 +2,9 @@
@section('title', '角色修改')
@section('content')
<h5 class="sub-header"><a href="/fladmin/userrole">角色列表</a> > 角色修改</h5>
<h5 class="sub-header"><a href="<?php echo route('admin_adminrole'); ?>">角色列表</a> > 角色修改</h5>
<form id="addarc" method="post" action="/fladmin/userrole/doedit" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<form id="addarc" method="post" action="<?php echo route('admin_adminrole_doedit'); ?>" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>

4
resources/views/admin/userrole/index.blade.php → resources/views/admin/adminrole/index.blade.php

@ -2,7 +2,7 @@
@section('title', '角色管理')
@section('content')
<h2 class="sub-header">角色管理</h2>[ <a href="/fladmin/userrole/add">添加角色</a> ]<br><br>
<h2 class="sub-header">角色管理</h2>[ <a href="<?php echo route('admin_adminrole_add'); ?>">添加角色</a> ]<br><br>
<form name="listarc"><div class="table-responsive"><table class="table table-striped table-hover">
<thead><tr>
@ -18,7 +18,7 @@
<td><?php echo $row->name; ?></td>
<td><?php echo $row->des; ?></td>
<td><?php if($row->status==0){echo '启用';}else{echo '禁用';} ?></td>
<td><?php if($row->id<>1){ ?><a href="/fladmin/userrole/permissions?id=<?php echo $row->id; ?>">权限设置</a> | <?php } ?><a href="/fladmin/userrole/edit?id=<?php echo $row->id; ?>">修改</a><?php if($row->id<>1){ ?> | <a onclick="delconfirm('/fladmin/userrole/del?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a><?php } ?></td>
<td><?php if($row->id<>1){ ?><a href="<?php echo route('admin_adminrole_permissions'); ?>?id=<?php echo $row->id; ?>">权限设置</a> | <?php } ?><a href="<?php echo route('admin_adminrole_edit'); ?>?id=<?php echo $row->id; ?>">修改</a><?php if($row->id<>1){ ?> | <a onclick="delconfirm('<?php echo route('admin_adminrole_del'); ?>?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a><?php } ?></td>
</tr><?php }} ?>
</tbody></table></div><!-- 表格结束 --></form><!-- 表单结束 -->

4
resources/views/admin/userrole/permissions.blade.php → resources/views/admin/adminrole/permissions.blade.php

@ -2,9 +2,9 @@
@section('title', '角色权限设置')
@section('content')
<h2 class="sub-header">角色权限设置</h2>[ <a href="<?php echo route('admin_userrole'); ?>">角色列表</a> ]<br><br>
<h2 class="sub-header">角色权限设置</h2>[ <a href="<?php echo route('admin_adminrole'); ?>">角色列表</a> ]<br><br>
<form method="post" action="<?php echo route('admin_userrole_dopermissions'); ?>" role="form" enctype="multipart/form-data" class="table-responsive"><div class="table-responsive">{{ csrf_field() }}
<form method="post" action="<?php echo route('admin_adminrole_dopermissions'); ?>" role="form" enctype="multipart/form-data" class="table-responsive"><div class="table-responsive">{{ csrf_field() }}
<input style="display:none;" name="role_id" type="text" id="role_id" value="<?php echo $role_id; ?>">
<ul class="list-group">
<?php if($menus){foreach($menus as $row){ ?>

138
resources/views/admin/order/detail.blade.php

@ -0,0 +1,138 @@
@extends('admin.layouts.app')
@section('title', '订单列表')
@section('content')
<script language="javascript" type="text/javascript" src="http://<?php echo env('APP_DOMAIN'); ?>/js/My97DatePicker/WdatePicker.js"></script>
<div class="bg-info" style="margin:10px 0;padding:10px;">
<div class="form-inline">
<div class="form-group">
当前可执行操作:
</div>
<button class="btn btn-info" onclick="show_search()">发货</button>
<button class="btn btn-success">设为付款</button>
<button class="btn btn-danger" onclick="show_search()">设为无效</button>
</div>
<div style="clear:both;"></div>
</div>
<h3 class="sub-header">基本信息</h3>
<!-- 表格开始 -->
<div class="table-responsive"><table class="table table-hover table-bordered">
<thead><tr class="info">
<th>订单编号</th>
<th>订单状态</th>
<th>下单人</th>
<th>下单时间</th>
<th>支付方式</th>
<th>支付时间</th>
<th>配送方式</th>
<th>快递单号</th>
<th>发货时间</th>
</tr></thead>
<tbody>
<tr>
<td><?php echo $post['order_sn']; ?></td>
<td><font color="red"><?php echo $post['order_status_text']; ?></font></td>
<td><?php if($post['user']['mobile']){echo $post['user']['mobile'];}else{echo $post['user']['user_name'];} ?></td>
<td><?php echo date('Y-m-d H:i:s',$post['add_time']); ?></td>
<td><?php echo $post['pay_name']; ?></td>
<td><?php if($post['pay_time']){echo date('Y-m-d H:i:s',$post['pay_time']);} ?></td>
<td><?php echo $post['shipping_name']; ?></td>
<td><?php echo $post['shipping_sn']; ?></td>
<td><?php if($post['shipping_time']){echo date('Y-m-d H:i:s',$post['shipping_time']);} ?></td>
</tr>
<tr>
<td colspan="1">订单来源:<?php echo $post['place_type_text']; ?></td>
<td colspan="8">客户留言:<?php echo $post['message']; ?></td>
</tr>
</tbody>
</table></div><!-- 表格结束 -->
<h3 class="sub-header">收货人信息</h3>
<!-- 表格开始 -->
<div class="table-responsive"><table class="table table-hover table-bordered">
<thead><tr class="info">
<th>收货人姓名</th>
<th>电话</th>
<th>详细地址</th>
</tr></thead>
<tbody>
<tr>
<td><?php echo $post['name']; ?></td>
<td><?php echo $post['mobile']; ?></td>
<td><?php echo $post['province_name'].$post['city_name'].$post['district_name'].' '.$post['address']; ?></td>
</tr>
</tbody>
</table></div><!-- 表格结束 -->
<h3 class="sub-header">商品信息</h3>
<!-- 表格开始 -->
<div class="table-responsive"><table class="table table-striped table-hover table-bordered">
<thead><tr class="info">
<th>商品缩略图</th>
<th>商品名称</th>
<th>商品价格</th>
<th>数量</th>
<th>合计</th>
<th>退货/退款</th>
<th>退货退款理由</th>
</tr></thead>
<tbody>
<?php if($post['goodslist']){foreach($post['goodslist'] as $k=>$v){ ?>
<tr>
<td width="98px"><img src="<?php echo $v['goods_img']; ?>" style="width:80px;height:60px;"></td>
<td><?php echo $v['goods_name']; ?></td>
<td><?php echo $v['goods_price']; ?></td>
<td><?php echo $v['goods_number']; ?></td>
<td><font color="red"><?php echo $v['goods_price']*$v['goods_number']; ?></font></td>
<td><?php echo $v['refund_status_text']; ?></td>
<td><?php echo $v['refund_reason']; ?></td>
</tr>
<?php }} ?>
</tbody>
</table></div><!-- 表格结束 -->
<?php if(empty($post['invoice']) || $post['invoice']!=0){ ?>
<h3 class="sub-header">发票信息</h3>
<!-- 表格开始 -->
<div class="table-responsive"><table class="table table-hover table-bordered">
<thead><tr class="info">
<th>发票类型</th>
<th>发票抬头</th>
<th>纳税人识别号</th>
</tr></thead>
<tbody>
<tr>
<td><?php echo $post['invoice_text']; ?></td>
<td><?php echo $post['invoice_title']; ?></td>
<td><?php echo $post['invoice_taxpayer_number']; ?></td>
</tr>
</tbody>
</table></div><!-- 表格结束 -->
<?php } ?>
<h3 class="sub-header">费用结算</h3>
<!-- 表格开始 -->
<div class="table-responsive"><table class="table table-hover table-bordered">
<thead><tr class="info">
<th>商品总金额</th>
<th>邮费</th>
<th>优惠券</th>
<th>积分</th>
<th>其它费用</th>
<th>应付金额</th>
</tr></thead>
<tbody>
<tr>
<td><?php echo $post['goods_amount']; ?></td>
<td>+<?php echo $post['shipping_fee']; ?></td>
<td>-<?php echo $post['bonus_money']; ?></td>
<td>-<?php echo $post['integral_money']; ?></td>
<td>-<?php echo $post['discount']; ?></td>
<td><font color="red"><?php echo $post['order_amount']; ?></font></td>
</tr>
</tbody>
</table></div><!-- 表格结束 -->
@endsection

60
resources/views/admin/order/index.blade.php

@ -2,26 +2,54 @@
@section('title', '订单列表')
@section('content')
<h2 class="sub-header">订单管理</h2>
<script language="javascript" type="text/javascript" src="http://<?php echo env('APP_DOMAIN'); ?>/js/My97DatePicker/WdatePicker.js"></script>
<form name="listarc"><div class="table-responsive"><table class="table table-striped table-hover">
<thead>
<tr>
<th>编号-SN</th>
<th>名称</th>
<th>是否显示</th>
<th>更新时间</th>
<th>管理</th>
</tr>
</thead>
<form name="listarc" action="" method="get">
<div class="bg-info" style="margin:10px 0;padding:10px;">
<div class="form-inline" style="display:inline;float:left;">
<div class="form-group">
<label for="order_sn">订单号:</label>
<input type="text" class="form-control" id="order_sn" name="order_sn" placeholder="">
</div>
<div class="form-group">
<label for="name">收货人:</label>
<input type="text" class="form-control" id="name" name="name" placeholder="">
</div>
<button type="submit" class="btn btn-success">查询</button>
<button class="btn btn-warning" onclick="show_search()">高级</button>
</div>
<div class="form-inline" style="display:inline;float:right;">
<div class="form-group">
<label for="min_addtime">导出列表:</label>
<input onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" class="form-control" id="min_addtime" name="min_addtime" placeholder="开始时间">
</div>
<div class="form-group">
<input onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" class="form-control" id="max_addtime" name="max_addtime" placeholder="结束时间">
</div>
<button onclick="javascript:output();" class="btn btn-success">导出</button>
</div>
<div style="clear:both;"></div>
</div>
<div class="table-responsive"><table class="table table-striped table-hover">
<thead><tr>
<th>订单编号SN-ID</th>
<th>支付信息</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.'-'.$row->order_sn; ?></td>
<td><a href="<?php echo route('admin_goodsbrand_edit',array('id'=>$row->id)); ?>"><?php echo $row->add_time; ?></a></td>
<td><?php if($row['status']==0){echo "";}else{echo "<font color=red>否</font>";} ?></td>
<td><?php echo date('Y-m-d',$row->add_time); ?></td>
<td><a href="<?php echo route('admin_goodsbrand_edit',array('id'=>$row->id)); ?>">修改</a>&nbsp;<a onclick="delconfirm('<?php echo route('admin_goodsbrand_del',array('id'=>$row->id)); ?>')" href="javascript:;">删除</a></td>
<td><a href="<?php echo route('admin_order_detail',array('id'=>$row->id)); ?>"><?php echo $row->order_sn.'-'.$row->id; ?></a>, 金额:<?php echo $row->order_amount; ?><br>下单时间:<?php echo date('Y-m-d H:i:s',$row->add_time); ?></td>
<td><?php if($row->pay_money){echo '支付金额:'.$row->pay_money;} ?><?php if($row->out_trade_no){echo ', 流水号:'.$row->out_trade_no;} ?><?php if($row->pay_name){echo '<br><font color="green">'.$row->pay_name.'</font>, ';} ?><?php if($row->pay_time){echo '支付时间:'.date('Y-m-d H:i:s',$row->pay_time);} ?></td>
<td><?php echo $row->name.'[TEL:'.$row->mobile.']'; ?><br><?php echo $row->province_name; ?><?php echo $row->city_name; ?><?php echo $row->district_name; ?></td>
<td><?php if($row->order_status_text=='待发货'){echo '<font color="red">'.$row->order_status_text.'</font>';}else{echo $row->order_status_text;} ?></td>
<td><?php if($row->place_type==1){echo 'pc';}elseif($row->place_type==2){echo 'weixin';}elseif($row->place_type==3){echo 'app';}elseif($row->place_type==4){echo 'wap';} ?></td>
<td><a href="<?php echo route('admin_order_detail',array('id'=>$row->id)); ?>">详情</a></td>
</tr>
<?php }} ?>
</tbody>

4
resources/views/admin/user/add.blade.php

@ -2,9 +2,9 @@
@section('title', '管理员添加')
@section('content')
<h5 class="sub-header"><a href="/fladmin/user">管理员列表</a> > 管理员添加</h5>
<h5 class="sub-header"><a href="<?php echo route('admin_admin'); ?>">管理员列表</a> > 管理员添加</h5>
<form id="addarc" method="post" action="/fladmin/user/doadd" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<form id="addarc" method="post" action="<?php echo route('admin_admin_doadd'); ?>" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>

4
resources/views/admin/user/edit.blade.php

@ -2,9 +2,9 @@
@section('title', '管理员修改')
@section('content')
<h5 class="sub-header"><a href="/fladmin/user">管理员列表</a> > 管理员修改</h5>
<h5 class="sub-header"><a href="<?php echo route('admin_admin'); ?>">管理员列表</a> > 管理员修改</h5>
<form id="addarc" method="post" action="/fladmin/user/doedit" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<form id="addarc" method="post" action="<?php echo route('admin_admin_doedit'); ?>" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>

4
resources/views/admin/user/index.blade.php

@ -2,7 +2,7 @@
@section('title', '管理员列表')
@section('content')
<h2 class="sub-header">管理员列表</h2>[ <a href="/fladmin/user/add">添加管理员</a> ]<br><br>
<h2 class="sub-header">管理员列表</h2>[ <a href="<?php echo route('admin_admin_add'); ?>">添加管理员</a> ]<br><br>
<form name="listarc"><div class="table-responsive"><table class="table table-striped table-hover">
<thead><tr>
@ -18,7 +18,7 @@
<td><?php echo $row->username; ?></td>
<td><?php echo $row->email; ?></td>
<td><?php if($row->status==0){echo '正常';}elseif($row->status==1){echo '禁用';}elseif($row->status==2){echo '禁用';} ?></td>
<td><a href="/fladmin/user/edit?id=<?php echo $row->id; ?>">修改</a><?php if($row->id<>1){ ?> | <a onclick="delconfirm('/fladmin/user/del?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a><?php } ?></td>
<td><a href="<?php echo route('admin_admin_edit'); ?>?id=<?php echo $row->id; ?>">修改</a><?php if($row->id<>1){ ?> | <a onclick="delconfirm('<?php echo route('admin_admin_del'); ?>?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a><?php } ?></td>
</tr><?php } ?>
</tbody></table></div><!-- 表格结束 --></form><!-- 表单结束 -->

26
routes/web.php

@ -297,6 +297,7 @@ Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['w
Route::get('/goodstype/del', 'GoodsTypeController@del')->name('admin_goodstype_del');
//订单
Route::get('/order', 'OrderController@index')->name('admin_order');
Route::get('/order/detail', 'OrderController@detail')->name('admin_order_detail');
Route::get('/order/edit', 'OrderController@edit')->name('admin_order_edit');
Route::post('/order/doedit', 'OrderController@doedit')->name('admin_order_doedit');
Route::get('/order/del', 'OrderController@del')->name('admin_order_del');
@ -345,22 +346,29 @@ Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['w
Route::get('/sysconfig/edit', 'SysconfigController@edit')->name('admin_sysconfig_edit');
Route::post('/sysconfig/doedit', 'SysconfigController@doedit')->name('admin_sysconfig_doedit');
Route::get('/sysconfig/del', 'SysconfigController@del')->name('admin_sysconfig_del');
//用户管理
//会员管理
Route::get('/user', 'UserController@index')->name('admin_user');
Route::get('/user/add', 'UserController@add')->name('admin_user_add');
Route::post('/user/doadd', 'UserController@doadd')->name('admin_user_doadd');
Route::get('/user/edit', 'UserController@edit')->name('admin_user_edit');
Route::post('/user/doedit', 'UserController@doedit')->name('admin_user_doedit');
Route::get('/user/del', 'UserController@del')->name('admin_user_del');
//管理员管理
Route::get('/admin', 'AdminController@index')->name('admin_admin');
Route::get('/admin/add', 'AdminController@add')->name('admin_admin_add');
Route::post('/admin/doadd', 'AdminController@doadd')->name('admin_admin_doadd');
Route::get('/admin/edit', 'AdminController@edit')->name('admin_admin_edit');
Route::post('/admin/doedit', 'AdminController@doedit')->name('admin_admin_doedit');
Route::get('/admin/del', 'AdminController@del')->name('admin_admin_del');
//角色管理
Route::get('/userrole', 'UserRoleController@index')->name('admin_userrole');
Route::get('/userrole/add', 'UserRoleController@add')->name('admin_userrole_add');
Route::post('/userrole/doadd', 'UserRoleController@doadd')->name('admin_userrole_doadd');
Route::get('/userrole/edit', 'UserRoleController@edit')->name('admin_userrole_edit');
Route::post('/userrole/doedit', 'UserRoleController@doedit')->name('admin_userrole_doedit');
Route::get('/userrole/del', 'UserRoleController@del')->name('admin_userrole_del');
Route::get('/userrole/permissions', 'UserRoleController@permissions')->name('admin_userrole_permissions'); //权限设置
Route::post('/userrole/dopermissions', 'UserRoleController@dopermissions')->name('admin_userrole_dopermissions');
Route::get('/adminrole', 'AdminRoleController@index')->name('admin_adminrole');
Route::get('/adminrole/add', 'AdminRoleController@add')->name('admin_adminrole_add');
Route::post('/adminrole/doadd', 'AdminRoleController@doadd')->name('admin_adminrole_doadd');
Route::get('/adminrole/edit', 'AdminRoleController@edit')->name('admin_adminrole_edit');
Route::post('/adminrole/doedit', 'AdminRoleController@doedit')->name('admin_adminrole_doedit');
Route::get('/adminrole/del', 'AdminRoleController@del')->name('admin_adminrole_del');
Route::get('/adminrole/permissions', 'AdminRoleController@permissions')->name('admin_adminrole_permissions'); //权限设置
Route::post('/adminrole/dopermissions', 'AdminRoleController@dopermissions')->name('admin_adminrole_dopermissions');
//菜单管理
Route::get('/menu', 'MenuController@index')->name('admin_menu');
Route::get('/menu/add', 'MenuController@add')->name('admin_menu_add');

Loading…
Cancel
Save