diff --git a/app/Http/Controllers/Admin/BonusController.php b/app/Http/Controllers/Admin/BonusController.php new file mode 100644 index 0000000..9095a24 --- /dev/null +++ b/app/Http/Controllers/Admin/BonusController.php @@ -0,0 +1,92 @@ +$v) + { + $data['posts'][$k]->status_text = Bonus::getStatusText(array('status'=>$v->status)); + } + } + + return view('admin.bonus.index', $data); + } + + public function add() + { + if(Helper::isPostRequest()) + { + if(isset($_POST['editorValue'])){unset($_POST['editorValue']);} + unset($_POST["_token"]); + + if(DB::table('bonus')->insert(array_filter($_POST))) + { + success_jump('添加成功!', route('admin_bonus')); + } + else + { + error_jump('添加失败!请修改后重新添加'); + } + } + + return view('admin.bonus.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('bonus')->where('id', $id)->update($_POST)) + { + success_jump('修改成功!', route('admin_bonus')); + } + 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('bonus')->where('id', $id)->first(), 1); + + return view('admin.bonus.edit', $data); + } + + public function del() + { + if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');} + + if(DB::table('bonus')->whereIn("id", explode(',', $id))->delete()) + { + success_jump('删除成功'); + } + else + { + error_jump('删除失败!请重新提交'); + } + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Admin/KuaidiController.php b/app/Http/Controllers/Admin/KuaidiController.php new file mode 100644 index 0000000..3a2895b --- /dev/null +++ b/app/Http/Controllers/Admin/KuaidiController.php @@ -0,0 +1,92 @@ +$v) + { + $data['posts'][$k]->status_text = Kuaidi::getStatusText(array('status'=>$v->status)); + } + } + + return view('admin.kuaidi.index', $data); + } + + public function add() + { + if(Helper::isPostRequest()) + { + if(isset($_POST['editorValue'])){unset($_POST['editorValue']);} + unset($_POST["_token"]); + + if(DB::table('kuaidi')->insert(array_filter($_POST))) + { + success_jump('添加成功!', route('admin_kuaidi')); + } + else + { + error_jump('添加失败!请修改后重新添加'); + } + } + + return view('admin.kuaidi.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('kuaidi')->where('id', $id)->update($_POST)) + { + success_jump('修改成功!', route('admin_kuaidi')); + } + 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('kuaidi')->where('id', $id)->first(), 1); + + return view('admin.kuaidi.edit', $data); + } + + public function del() + { + if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');} + + if(DB::table('kuaidi')->whereIn("id", explode(',', $id))->delete()) + { + success_jump('删除成功'); + } + else + { + error_jump('删除失败!请重新提交'); + } + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index 49a8145..df6521d 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -93,20 +93,28 @@ class UserController extends CommonController public function add() { - return view('admin.user.add'); - } - - public function doadd() - { - unset($_POST["_token"]); - if(DB::table('user')->insert($_POST)) + if(Helper::isPostRequest()) { - success_jump('添加成功!', route('admin_user')); + unset($_POST["_token"]); + + if(DB::table('user')->where('user_name', $_POST["user_name"])->first()){error_jump('用户名已经存在');} + if(DB::table('user')->where('mobile', $_POST["mobile"])->first()){error_jump('手机号已经存在');} + $_POST['password'] = md5($_POST['password']); + $_POST['add_time'] = time(); + + if(DB::table('user')->insert($_POST)) + { + success_jump('添加成功!', route('admin_user')); + } + else + { + error_jump('添加失败!请修改后重新添加'); + } } - else - { - error_jump('添加失败!请修改后重新添加'); - } + + $data['user_rank'] = DB::table('user_rank')->orderBy('rank', 'asc')->get(); + + return view('admin.user.add',$data); } public function edit() diff --git a/app/Http/Controllers/Admin/UserRankController.php b/app/Http/Controllers/Admin/UserRankController.php index b20a4e2..30cd2c8 100644 --- a/app/Http/Controllers/Admin/UserRankController.php +++ b/app/Http/Controllers/Admin/UserRankController.php @@ -35,9 +35,12 @@ class UserRankController extends CommonController if(isset($_POST['editorValue'])){unset($_POST['editorValue']);} unset($_POST["_token"]); + if(DB::table('user_rank')->where('rank', $_POST["rank"])->first()){error_jump('等级已经存在');} + if(DB::table('user_rank')->where('title', $_POST["title"])->first()){error_jump('等级名称已经存在');} + if(DB::table('user_rank')->insert(array_filter($_POST))) { - success_jump('添加成功!', route('admin_slide')); + success_jump('添加成功!', route('admin_userrank')); } else { @@ -57,9 +60,12 @@ class UserRankController extends CommonController if(isset($_POST['editorValue'])){unset($_POST['editorValue']);} unset($_POST["_token"]); - if(DB::table('user_rank')->where('id', $id)->update($_POST)) + if(DB::table('user_rank')->where(['rank'=>$_POST["rank"],'id'=>['<>',$id]])->first()){error_jump('等级已经存在');} + if(DB::table('user_rank')->where(['title'=>$_POST["title"],'id'=>['<>',$id]])->first()){error_jump('等级名称已经存在');} + + if(DB::table('user_rank')->where('id', $id)->update($_POST) !== false) { - success_jump('修改成功!', route('admin_slide')); + success_jump('修改成功!', route('admin_userrank')); } else { diff --git a/app/Http/Model/Kuaidi.php b/app/Http/Model/Kuaidi.php new file mode 100644 index 0000000..4279ce8 --- /dev/null +++ b/app/Http/Model/Kuaidi.php @@ -0,0 +1,30 @@ +快递列表 > 添加快递 + +
{{ csrf_field() }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
快递名称:
编码:
金额:
说明:
电话:
官网:
是否显示: +  是   +  否 +
排序: + +
  
+ +@endsection \ No newline at end of file diff --git a/resources/views/admin/bonus/edit.blade.php b/resources/views/admin/bonus/edit.blade.php new file mode 100644 index 0000000..b24c8ba --- /dev/null +++ b/resources/views/admin/bonus/edit.blade.php @@ -0,0 +1,79 @@ +@extends('admin.layouts.app') +@section('title', '快递修改') + +@section('content') +
快递列表 > 快递修改
+ +
{{ csrf_field() }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
快递名称:
编码:
金额:
说明:
电话:
官网:
是否显示: + /> 是   + /> 否 +
排序: + +
  
+ +@endsection \ No newline at end of file diff --git a/resources/views/admin/bonus/index.blade.php b/resources/views/admin/bonus/index.blade.php new file mode 100644 index 0000000..5252cd0 --- /dev/null +++ b/resources/views/admin/bonus/index.blade.php @@ -0,0 +1,36 @@ +@extends('admin.layouts.app') +@section('title', '快递列表') + +@section('content') +

快递管理

[ 添加快递 ]

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ID快递名称编码金额说明电话官网排序是否显示管理
id; ?>name; ?>code; ?>money; ?>des; ?>tel; ?>website; ?>listorder; ?>status==0){echo "是";}else{echo "";} ?>修改 | 删除
+ + +@endsection \ No newline at end of file diff --git a/resources/views/admin/kuaidi/add.blade.php b/resources/views/admin/kuaidi/add.blade.php new file mode 100644 index 0000000..b7479f5 --- /dev/null +++ b/resources/views/admin/kuaidi/add.blade.php @@ -0,0 +1,79 @@ +@extends('admin.layouts.app') +@section('title', '快递添加') + +@section('content') +
快递列表 > 添加快递
+ +
{{ csrf_field() }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
快递名称:
编码:
金额:
说明:
电话:
官网:
是否显示: +  是   +  否 +
排序: + +
  
+ +@endsection \ No newline at end of file diff --git a/resources/views/admin/kuaidi/edit.blade.php b/resources/views/admin/kuaidi/edit.blade.php new file mode 100644 index 0000000..b24c8ba --- /dev/null +++ b/resources/views/admin/kuaidi/edit.blade.php @@ -0,0 +1,79 @@ +@extends('admin.layouts.app') +@section('title', '快递修改') + +@section('content') +
快递列表 > 快递修改
+ +
{{ csrf_field() }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
快递名称:
编码:
金额:
说明:
电话:
官网:
是否显示: + /> 是   + /> 否 +
排序: + +
  
+ +@endsection \ No newline at end of file diff --git a/resources/views/admin/kuaidi/index.blade.php b/resources/views/admin/kuaidi/index.blade.php new file mode 100644 index 0000000..5252cd0 --- /dev/null +++ b/resources/views/admin/kuaidi/index.blade.php @@ -0,0 +1,36 @@ +@extends('admin.layouts.app') +@section('title', '快递列表') + +@section('content') +

快递管理

[ 添加快递 ]

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ID快递名称编码金额说明电话官网排序是否显示管理
id; ?>name; ?>code; ?>money; ?>des; ?>tel; ?>website; ?>listorder; ?>status==0){echo "是";}else{echo "";} ?>修改 | 删除
+ + +@endsection \ No newline at end of file diff --git a/resources/views/admin/user/add.blade.php b/resources/views/admin/user/add.blade.php index 772a67f..74314f1 100644 --- a/resources/views/admin/user/add.blade.php +++ b/resources/views/admin/user/add.blade.php @@ -1,34 +1,52 @@ @extends('admin.layouts.app') -@section('title', '管理员添加') +@section('title', '会员添加') @section('content') -
管理员列表 > 管理员添加
+
会员列表 > 会员添加
-
{{ csrf_field() }} +{{ csrf_field() }} - - + + + + + + - + - - + + - + + + + + + + + + diff --git a/resources/views/admin/userrank/add.blade.php b/resources/views/admin/userrank/add.blade.php index 68d31ed..7c898e9 100644 --- a/resources/views/admin/userrank/add.blade.php +++ b/resources/views/admin/userrank/add.blade.php @@ -1,42 +1,19 @@ @extends('admin.layouts.app') -@section('title', '轮播图添加') +@section('title', '会员等级添加') @section('content') -
轮播图列表 > 添加轮播图
+
会员等级列表 > 添加会员等级
-{{ csrf_field() }} +{{ csrf_field() }}
用户名:用户名:
手机号:
密码:
邮箱:金额
角色:性别: - + +
会员等级: + +
父级id
  
- + - - - - - - - - - - - - - - + + @@ -44,46 +21,6 @@ - - - - - - - - - - - - diff --git a/resources/views/admin/userrank/edit.blade.php b/resources/views/admin/userrank/edit.blade.php index a641795..393da41 100644 --- a/resources/views/admin/userrank/edit.blade.php +++ b/resources/views/admin/userrank/edit.blade.php @@ -1,42 +1,19 @@ @extends('admin.layouts.app') -@section('title', '轮播图修改') +@section('title', '会员等级修改') @section('content') -
轮播图列表 > 轮播图修改
+
会员等级列表 > 会员等级修改
-{{ csrf_field() }} +{{ csrf_field() }}
标题:等级名称:
链接网址: (请用绝对地址)
跳转方式: -  _blank   -  _self -
显示平台: -  pc   -  weixin   -  app   -  wap -
是否显示: -  是   -  否 - 等级:
排序:
所属的组: - -
图片:
  
- + - - - - - - - - - - - - - - + + @@ -44,46 +21,6 @@ - - - - - - - - - - - - diff --git a/routes/web.php b/routes/web.php index 05c7ed0..69f7994 100644 --- a/routes/web.php +++ b/routes/web.php @@ -301,6 +301,16 @@ Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['w 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'); + //快递管理 + Route::get('/kuaidi', 'KuaidiController@index')->name('admin_kuaidi'); + Route::any('/kuaidi/add', 'KuaidiController@add')->name('admin_kuaidi_add'); + Route::any('/kuaidi/edit', 'KuaidiController@edit')->name('admin_kuaidi_edit'); + Route::get('/kuaidi/del', 'KuaidiController@del')->name('admin_kuaidi_del'); + //优惠券管理 + Route::get('/bonus', 'BonusController@index')->name('admin_bonus'); + Route::any('/bonus/add', 'BonusController@add')->name('admin_bonus_add'); + Route::any('/bonus/edit', 'BonusController@edit')->name('admin_bonus_edit'); + Route::get('/bonus/del', 'BonusController@del')->name('admin_bonus_del'); //商品品牌 Route::get('/goodsbrand', 'GoodsBrandController@index')->name('admin_goodsbrand'); Route::get('/goodsbrand/add', 'GoodsBrandController@add')->name('admin_goodsbrand_add'); @@ -355,8 +365,7 @@ Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['w Route::get('/feedback/del', 'FeedbackController@del')->name('admin_feedback_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::any('/user/add', 'UserController@add')->name('admin_user_add'); Route::any('/user/edit', 'UserController@edit')->name('admin_user_edit'); Route::get('/user/del', 'UserController@del')->name('admin_user_del'); Route::get('/user/money', 'UserController@money')->name('admin_user_money'); //会员账户记录
标题:等级名称:
链接网址: (请用绝对地址)
跳转方式: - /> _blank   - /> _self -
显示平台: - /> pc   - /> weixin   - /> app   - /> wap -
是否显示: - /> 是   - /> 否 - 等级:
排序:
所属的组: - -
图片: " src="" width="120" height="80" id="picview">