sunhao vor 5 Jahren
Ursprung
Commit
9e4e39152f

+ 17 - 0
app/CustomerConsum.php

@@ -0,0 +1,17 @@
1
+<?php
2
+/**
3
+ * Created by PhpStorm.
4
+ * User: Administrator
5
+ * Date: 2017/12/5
6
+ * Time: 15:07
7
+ */
8
+
9
+namespace App;
10
+use Illuminate\Database\Eloquent\Model;
11
+
12
+class CustomerConsum extends Model
13
+{
14
+    public $timestamps = false;
15
+    protected $table = "customer_consum";
16
+   
17
+}

+ 17 - 0
app/CustomerDeposit.php

@@ -0,0 +1,17 @@
1
+<?php
2
+/**
3
+ * Created by PhpStorm.
4
+ * User: Administrator
5
+ * Date: 2017/12/5
6
+ * Time: 15:07
7
+ */
8
+
9
+namespace App;
10
+use Illuminate\Database\Eloquent\Model;
11
+
12
+class CustomerDeposit extends Model
13
+{
14
+    public $timestamps = false;
15
+    protected $table = "customer_deposit";
16
+   
17
+}

+ 17 - 0
app/CustomerDepositPackages.php

@@ -0,0 +1,17 @@
1
+<?php
2
+/**
3
+ * Created by PhpStorm.
4
+ * User: Administrator
5
+ * Date: 2017/12/5
6
+ * Time: 15:07
7
+ */
8
+
9
+namespace App;
10
+use Illuminate\Database\Eloquent\Model;
11
+
12
+class CustomerDepositPackages extends Model
13
+{
14
+    public $timestamps = false;
15
+    protected $table = "customer_deposit_packages";
16
+   
17
+}

+ 17 - 0
app/CustomerInfo.php

@@ -0,0 +1,17 @@
1
+<?php
2
+/**
3
+ * Created by PhpStorm.
4
+ * User: Administrator
5
+ * Date: 2017/12/5
6
+ * Time: 15:07
7
+ */
8
+
9
+namespace App;
10
+use Illuminate\Database\Eloquent\Model;
11
+
12
+class CustomerInfo extends Model
13
+{
14
+    public $timestamps = false;
15
+    protected $table = "customer_info";
16
+   
17
+}

+ 210 - 0
app/Http/Controllers/Admin/CustomerDepositController.php

@@ -0,0 +1,210 @@
1
+<?php
2
+/**
3
+ * Created by Sublime.
4
+ * User: Williamslife Wang
5
+ * Date: 17/10/18
6
+ * Time: 上午11:20
7
+ */
8
+namespace  App\Http\Controllers\Admin;
9
+use App\Http\Controllers\Controller;
10
+use App\Admin;
11
+use Illuminate\Http\Request;
12
+use App\CustomerInfo;
13
+use App\CustomerDeposit;
14
+use App\CustomerConsum;
15
+use App\CustomerDepositPackages;
16
+use Illuminate\Support\Facades\DB;
17
+
18
+class CustomerDepositController extends Controller
19
+{
20
+    /**
21
+     * @return \Illuminate\View\View
22
+     */
23
+    public function customerList(Request $request)
24
+    {
25
+        $phone = trim( $request->input('phone') );
26
+        $name = trim( $request->input('name') );
27
+        $page = (int)$request->input('page');
28
+        $pageSize = 20;
29
+        if($page<=0){
30
+            $page = 1;
31
+        }
32
+
33
+        $offset = ($page-1) * $pageSize;
34
+
35
+        $count = CustomerInfo::where(function($query) use($phone, $name){
36
+            if($phone) $query->where('phone', $phone);
37
+            if($name) $query->where('name', 'like', '%'. $name. '%');
38
+        })->count();
39
+        if ($count > 1) {
40
+            // 总页数
41
+            $pages = ceil($count/$pageSize);
42
+        }else{
43
+            // 总页数
44
+            $pages = 1;
45
+        }
46
+
47
+        $result = CustomerInfo::where(function($query) use($phone, $name){
48
+            if($phone) $query->where('phone', $phone);
49
+            if($name) $query->where('name', 'like', '%'. $name. '%');
50
+        })->orderBy('id', 'desc')->offset($offset)->limit($pageSize)->get();
51
+        $result = json_decode(json_encode($result),true);
52
+
53
+        return view('deposit/customerList', ['result' =>$result,
54
+            'page'              =>$page,
55
+            'count'             =>$count,
56
+            'pages'             =>$pages,                   
57
+            'phone'             =>$phone,                   
58
+            'name'             =>$name,                   
59
+            ]);
60
+    }
61
+
62
+    /**
63
+     * @return \Illuminate\View\View
64
+     */
65
+    public function index(Request $request)
66
+    {
67
+        $phone = $request->input('phone');
68
+        $page = (int)$request->input('page');
69
+        $pageSize = 20;
70
+        if($page<=0){
71
+            $page = 1;
72
+        }
73
+
74
+        $offset = ($page-1) * $pageSize;
75
+
76
+        $count = CustomerDeposit::where(function($query) use($phone){
77
+            if($phone) $query->where('phone', $phone);
78
+        })->where('is_del',0)->count();
79
+        if ($count > 1) {
80
+            // 总页数
81
+            $pages = ceil($count/$pageSize);
82
+        }else{
83
+            // 总页数
84
+            $pages = 1;
85
+        }
86
+
87
+        $result = CustomerDeposit::where(function($query) use($phone){
88
+            if($phone) $query->where('phone', $phone);
89
+        })->where('is_del',0)->orderBy('pay_time', 'desc')->offset($offset)->limit($pageSize)->get();
90
+        $result = json_decode(json_encode($result),true);
91
+
92
+        return view('deposit/index', ['result' =>$result,
93
+            'page'              =>$page,
94
+            'count'             =>$count,
95
+            'pages'             =>$pages,  
96
+            'phone'             =>$phone                 
97
+            ]);
98
+    }
99
+
100
+    /**
101
+     * @return \Illuminate\View\View
102
+     */
103
+    public function create(Request $request)
104
+    {
105
+        $phone = $request->input('phone');
106
+        //查询套餐
107
+        $packages = CustomerDepositPackages::where('is_del', 0)->orderBy('pay_amount', 'asc')->get();
108
+        return view('deposit/create', ['packages'=>$packages, 'phone'=>$phone]);
109
+    }
110
+
111
+    /**
112
+     * @param Request $request
113
+     * @return \Illuminate\Http\RedirectResponse
114
+     */
115
+    public function store(Request $request)
116
+    {
117
+        $this->validate($request, [
118
+            'phone' => 'required',   
119
+            'package_id' => 'required',        
120
+            'pay_time' => 'required',        
121
+                
122
+        ], [
123
+            'phone.required' => '手机号不能为空',
124
+            'package_id.required' => '必须选择套餐',
125
+            'pay_time.required' => '充值时间必须选择',
126
+            
127
+        ]);
128
+        $admin_id = session('admin_id');
129
+        $package_id = (int)$request->input('package_id');
130
+        $package_info = CustomerDepositPackages::where('id', $package_id)->first();
131
+
132
+        $deposit = new CustomerDeposit();
133
+        $deposit->phone = $request->input('phone');
134
+        $deposit->pay_amount = $package_info->pay_amount;
135
+        $deposit->discount = $package_info->discount;
136
+        $deposit->deposit_amount = $deposit->pay_amount + $deposit->discount;
137
+        $deposit->note = $package_info->note;
138
+        $deposit->admin_id = $admin_id;
139
+        $deposit->pay_time = $request->input('pay_time');
140
+    
141
+        if($deposit->save()){
142
+            //变更余额
143
+            $name = trim( $request->input('name') );
144
+            $customerInfo = CustomerInfo::where('phone', $deposit->phone)->first();
145
+            if(!empty($customerInfo)){
146
+                $customerInfo->balance = $customerInfo->balance + $deposit->deposit_amount;
147
+                $customerInfo->deposit_total = $customerInfo->deposit_total + $deposit->deposit_amount;
148
+                $customerInfo->deposit_times = $customerInfo->deposit_times + 1;
149
+                $customerInfo->save();
150
+            }else{
151
+                $customerInfo = new CustomerInfo();
152
+                $customerInfo->phone = $deposit->phone;
153
+                $customerInfo->deposit_times = 1;
154
+                $customerInfo->balance = $deposit->deposit_amount;
155
+                $customerInfo->deposit_total = $deposit->deposit_amount;
156
+                if(!empty($name)) $customerInfo->name = $name;
157
+                $customerInfo->admin_id = $admin_id;
158
+                $customerInfo->save();
159
+            }
160
+        }
161
+        return redirect('/admin/deposit/index?phone='.$deposit->phone)->with('info', '添加成功');
162
+    }
163
+
164
+    /**
165
+     * @param $id
166
+     * @return \Illuminate\View\View
167
+     */
168
+    public function edit($id)
169
+    {
170
+        $deposit = CustomerDeposit::findOrFail($id);
171
+        return view('deposit/edit', ['deposit' => $deposit, 'id'=>$id]);
172
+    }
173
+
174
+    /**
175
+     * @param Request $request
176
+     * @return \Illuminate\Http\RedirectResponse
177
+     */
178
+    public function update(Request $request)
179
+    {
180
+        $id = (int)$request->input('id');
181
+        $this->validate($request, [
182
+            'phone' => 'required',   
183
+            'pay_amount' => 'required',        
184
+            'discount' => 'required',                
185
+        ], [
186
+            'phone.required' => '手机号不能为空',
187
+            'pay_amount.required' => '参数有误',
188
+            'discount.required' => '参数有误',
189
+            
190
+        ]);
191
+
192
+        $template = Templates::findOrFail($id);
193
+        $template->url = trim($request->input('url'));
194
+        $template->note = trim($request->input('note'));
195
+    
196
+        //图片上传 阿里云oss       
197
+        if ($request->hasFile('img') && $request->file('img')->isValid()) {
198
+            $file = $request->file('img');
199
+            $ossClient=new oss();
200
+            // 上传阿里云
201
+            $file = $ossClient->upload($file->getClientOriginalExtension(), $file->getRealPath(), 'upload/seafoodPic'.date("Y-m-d",time()).'/'.date('His'));
202
+            $img=$file['oss-request-url'];
203
+            $template->img=str_replace("kx-youhuiquan.oss-cn-beijing.aliyuncs.com","imgs.726p.com",$img);
204
+        }
205
+
206
+        $template->save();
207
+        return redirect('/admin/template/index')->with('info', '修改模板成功');
208
+    }
209
+
210
+}

+ 9 - 0
app/Http/routes.php

@@ -237,6 +237,15 @@ Route::group(['prefix' => 'admin'], function(){
237 237
         Route::get('statistics/volumeRank',   'Admin\StatisticsController@volumeRank');
238 238
         Route::get('statistics/volumeRank_export',   'Admin\StatisticsController@volumeRank_export');
239 239
 
240
+        //充值
241
+        Route::get('deposit/index', 'Admin\CustomerDepositController@index');
242
+        Route::get('deposit/customerList', 'Admin\CustomerDepositController@customerList');
243
+        Route::get('deposit/create', 'Admin\CustomerDepositController@create');
244
+        Route::post('deposit/store', 'Admin\CustomerDepositController@store');
245
+        Route::get('deposit/edit', 'Admin\CustomerDepositController@edit');
246
+        Route::post('deposit/update', 'Admin\CustomerDepositController@update');
247
+        Route::get('deposit/del/{id}', 'Admin\CustomerDepositController@delete');
248
+
240 249
     });
241 250
     
242 251
 });

+ 10 - 0
resources/views/admin/index.blade.php

@@ -103,6 +103,16 @@
103 103
                 </dd>
104 104
             </dl>
105 105
 
106
+             <dl id="menu-deposit">
107
+                <dt @if(!isset($res['deposit/manage'])) style="display:none;list-style-type:none;" @endif><i class="Hui-iconfont">&#xe634;</i> 充值管理<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
108
+                <dd>
109
+                    <ul>                       
110
+                        <li @if(!isset($res['deposit/manage'])) style="display:none;list-style-type:none;" @endif><a data-href="{{url('admin/deposit/customerList')}}" data-title="客户充值信息" href="javascript:void(0)">客户充值信息</a></li>                        
111
+                    </ul>
112
+                   
113
+                </dd>
114
+            </dl>
115
+
106 116
             <dl id="menu-order">
107 117
                 <dt @if(!isset($res['statistics/manage'])) style="display:none;list-style-type:none;" @endif><i class="Hui-iconfont">&#xe623;</i> 报表管理<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
108 118
                 <dd>

+ 115 - 0
resources/views/deposit/create.blade.php

@@ -0,0 +1,115 @@
1
+@extends('admin/master')
2
+@section('content')
3
+    <body>
4
+    @if(count($errors) > 0)
5
+        <div class="Huialert Huialert-info" id="error">
6
+            @foreach($errors->all() as $error)
7
+                <li>{{$error}}</li>
8
+            @endforeach
9
+        </div>
10
+    @endif
11
+    <div class="page-container">
12
+        <form action="/admin/deposit/store" method="post" class="form form-horizontal">
13
+            <input type="hidden" name="_token" value="{{ csrf_token() }}" />
14
+            @if(!$phone)
15
+            <div class="row cl">
16
+                <label class="form-label col-xs-4 col-sm-2">
17
+                    用户名:</label>
18
+                <div class="formControls col-xs-6 col-sm-6">
19
+                    <input type="text" class="input-text" value="{{old('name')}}" placeholder="" name="name">
20
+                </div>
21
+            </div>
22
+            <div class="row cl">
23
+                <label class="form-label col-xs-4 col-sm-2">
24
+                    <font color='red'>* </font>手机号:</label>
25
+                <div class="formControls col-xs-6 col-sm-6">
26
+                    <input type="text" class="input-text" value="{{old('phone')}}" placeholder="" name="phone">
27
+                </div>
28
+            </div>
29
+            @else
30
+             <div class="row cl">
31
+                <label class="form-label col-xs-4 col-sm-2">
32
+                    <font color='red'>* </font>账号:</label>
33
+                <div class="formControls col-xs-6 col-sm-6">
34
+                    {{$phone}}
35
+                    <input type="hidden" class="input-text" value="{{$phone}}" placeholder="" name="phone">
36
+                    
37
+                </div>
38
+            </div>
39
+            @endif
40
+            <div class="row cl">
41
+                <label class="form-label col-xs-4 col-sm-2">
42
+                    <font color='red'>* </font>选择套餐:</label>
43
+                <div class="formControls col-xs-6 col-sm-6">
44
+                    <span class="select-box">
45
+                        <select  size="1" name="package_id" id='package_id'>
46
+                            <option value="0" @if(old('package_id')=='0') selected @endif>- 请选择 -</option>
47
+                        
48
+                            @foreach($packages as $package)
49
+                            <option value="{{$package['id']}}"  @if(old('package_id')=='{{$package["id"]}}') selected @endif >{{$package['note']}}</option>
50
+                            @endforeach      
51
+                                       
52
+                        </select>
53
+                    </span>
54
+                </div>
55
+            </div>
56
+            <div class="row cl">
57
+                <label class="form-label col-xs-4 col-sm-2">
58
+                    <font color='red'>* </font>充值时间:</label>
59
+                <div class="formControls col-xs-6 col-sm-6">
60
+                    <input id="pay_time" type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss' })" autocomplete="off"  class="input-text Wdate" style="width:30%;text-align:center;" name="pay_time" value="{{old('pay_time')}}"> <font color='red'>  </font>                  
61
+                </div>
62
+            </div>
63
+            <div class="row cl">
64
+                <div class="col-9 col-offset-2">
65
+                    <button class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>&nbsp;
66
+                    <button class="btn btn-default" type="reset" onclick="return_index();">&nbsp;&nbsp;返回&nbsp;&nbsp;</button>&nbsp;
67
+                    {{--<a href="javascript:void(0)" class="btn btn-default radius" onclick="redirect('{{url('/admin/admin/all')}}')">返回并查看结果</a>--}}
68
+                </div>
69
+            </div>
70
+        </form>
71
+    </div>
72
+    <!--_footer 作为公共模版分离出去-->
73
+    <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
74
+    <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
75
+    <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
76
+    <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
77
+    <!--/_footer 作为公共模版分离出去-->
78
+
79
+    <!--请在下方写此页面业务相关的脚本-->
80
+    <script type="text/javascript" src="/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
81
+    <script type="text/javascript">
82
+        $(function(){
83
+            setTimeout("$('#error').hide()",3000);
84
+            var tdate = today_date();
85
+            $('#pay_time').val(tdate);
86
+        });
87
+        /*返回*/
88
+        function return_index(){
89
+            var phone = '{{$phone}}'
90
+            if(phone){
91
+                location.href='/admin/deposit/index?phone='+phone;
92
+            }
93
+            else{
94
+                location.href='/admin/deposit/customerList';
95
+            }
96
+        }
97
+
98
+        function today_date(){
99
+            var today=new Date();
100
+            var h=today.getFullYear();
101
+            var m=today.getMonth()+1;
102
+            var d=today.getDate();
103
+            var hh=today.getHours();
104
+            var mm=today.getMinutes();
105
+            var ss=today.getSeconds();
106
+            m= m<10?"0"+m:m;     
107
+            d= d<10?"0"+d:d;
108
+            hh = hh < 10 ? "0" + hh:hh;
109
+            mm = mm < 10 ? "0" +  mm:mm;
110
+            ss = ss < 10 ? "0" + ss:ss;
111
+            return h+"-"+m+"-"+d+" "+hh+":"+mm+":"+ss;
112
+        }
113
+    </script>
114
+    </body>
115
+@endsection

+ 99 - 0
resources/views/deposit/customerList.blade.php

@@ -0,0 +1,99 @@
1
+@extends('admin/master')
2
+@section('content')
3
+    <body>
4
+    @if(session('info'))
5
+        <div class="Huialert Huialert-info" onclick="$(this).remove()" id="info">
6
+            {{session('info')}}
7
+        </div>
8
+    @endif
9
+    <div class="page-container">
10
+        <div>
11
+            <input class="input-text" style="width:6%;text-align:center" type="text" value="客户名"/>
12
+            <input id="name" type="text"  class="input-text" style="width:10%;text-align:center" name="name" value="{{$name?$name:''}}">
13
+            <input class="input-text" style="width:6%;text-align:center" type="text" value="手机号"/>
14
+            <input id="phone" type="text"  class="input-text" style="width:10%;text-align:center" name="phone" value="{{$phone?$phone:''}}">
15
+            <a class="btn btn-primary radius" onclick="user_search()" href="javascript:;">搜索</a>
16
+            <a class="btn btn-primary radius" onclick="admin_add('新增')" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 新增充值记录</a>
17
+        </div>
18
+        <div class="mt-20">
19
+            <table class="table table-border table-bordered table-bg table-hover table-sort">
20
+                <thead>
21
+                <tr class="text-c">
22
+                    {{--<th width="25"><input type="checkbox" name="" value=""></th>--}}
23
+                    <th width="10%">姓名</th>
24
+                    <th width="10%">手机号</th>                   
25
+                    <th width="10%">充值次数</th>
26
+                    <th width="10%">累计充值金额</th>
27
+                    <th width="10%">账户余额</th>
28
+                    <th width="10%">操作</th>
29
+                </tr>
30
+                </thead>
31
+                <tbody>
32
+                @if($result)
33
+                @foreach($result as $a)
34
+                    <tr class="text-c">
35
+                        {{--<td><input name="" type="checkbox" value=""></td>--}}
36
+                        <td class="text-c">{{$a['name']}}</td>
37
+                        <td class="text-c">{{$a['phone']}}</td>
38
+                        <td class="text-c">{{$a['deposit_times']}}</td>
39
+                        <td class="text-c">{{$a['deposit_total']}}</td>
40
+                        <td class="text-c">{{$a['balance']}}</td>
41
+                        <td class="f-14 product-brand-manage"><!--a style="text-decoration:none" onClick='admin_edit("编辑团队","{{$a['id']}}")' href="javascript:;" title="编辑团队"><span class="btn btn-primary radius">编辑</span></a> <a style="text-decoration:none" class="ml-5" onClick="admin_del(this, '{{$a['id']}}')" href="javascript:;" title="删除"><span class="btn btn-danger radius">删除</span></a-->
42
+                            <a style="text-decoration:none" onClick='depositlist("查看充值记录","{{$a['phone']}}")' href="javascript:;" title="查看充值记录"><span class="btn btn-primary radius">查看充值记录</span></a>
43
+                        </td>
44
+                    </tr>
45
+                @endforeach
46
+                @endif
47
+                </tbody>
48
+            </table>
49
+        </div>
50
+        <div id="page" class="page_div"></div>
51
+    </div>
52
+
53
+    <!--_footer 作为公共模版分离出去-->
54
+    <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
55
+    <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
56
+    <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
57
+    <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
58
+    <script type="text/javascript" src="/admin/lib/page/paging.js"></script>
59
+    <!--/_footer 作为公共模版分离出去-->
60
+    <!--/_footer 作为公共模版分离出去-->
61
+
62
+    <script type="text/javascript">
63
+        $(function(){
64
+            setTimeout("$('#info').hide()",3000);
65
+        });
66
+        /*管理员-添加*/
67
+        function admin_add(title){
68
+            location.href = '/admin/deposit/create';
69
+        }
70
+        /*管理员-编辑*/
71
+        function admin_edit(title,id){
72
+            location.href = "/admin/admin/teamedit/"+id;
73
+        }
74
+
75
+        function depositlist(title,phone){
76
+            location.href = '/admin/deposit/index?phone='+phone;
77
+        }
78
+        function user_search(){
79
+            var phone = $('#phone').val();
80
+            var name = $('#name').val();
81
+            location.href='customerList?page='+num + '&name='+name + '&phone='+phone;
82
+        }
83
+
84
+        $("#page").paging({ 
85
+            pageNo:{{$page}},
86
+            totalPage: {{$pages}},
87
+            totalSize: {{$count}},
88
+            callback: function(num) {
89
+                var phone = $('#phone').val();
90
+                var name = $('#name').val();
91
+                location.href='customerList?page='+num + '&name='+name + '&phone='+phone;
92
+            }
93
+        })
94
+        
95
+
96
+    </script>
97
+    </body>
98
+
99
+@endsection

+ 50 - 0
resources/views/deposit/edit.blade.php

@@ -0,0 +1,50 @@
1
+@extends('admin/master')
2
+@section('content')
3
+    <body>
4
+    @if(count($errors) > 0)
5
+        <div class="Huialert Huialert-info" id="error">
6
+            @foreach($errors->all() as $error)
7
+                <li>{{$error}}</li>
8
+            @endforeach
9
+        </div>
10
+    @endif
11
+    <div class="page-container">
12
+        <form action="/admin/admin/teamupdate" method="post" class="form form-horizontal">
13
+            <input type="hidden" name="_token" value="{{ csrf_token() }}" />
14
+            <input type="hidden" name="id" value="{{$team['id']}}" />
15
+            <div class="row cl">
16
+                <label class="form-label col-xs-4 col-sm-2">
17
+                    团队名:</label>
18
+                <div class="formControls col-xs-6 col-sm-6">
19
+                    <input type="text" class="input-text" @if(old('name')) value="{{old('name')}}" @else value="{{$team['name']}}" @endif placeholder="" name="name" >
20
+                </div>
21
+            </div>
22
+            
23
+            <div class="row cl">
24
+                <div class="col-9 col-offset-2">
25
+                    <button class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">&nbsp;&nbsp;修改&nbsp;&nbsp;</button>&nbsp;
26
+                    <button class="btn btn-default" type="reset" onclick="return_index();">&nbsp;&nbsp;返回&nbsp;&nbsp;</button>&nbsp;
27
+                    {{--<a href="javascript:void(0)" class="btn btn-default radius" onclick="redirect('{{url('/admin/admin/all')}}')">返回并查看结果</a>--}}
28
+                </div>
29
+            </div>
30
+        </form>
31
+    </div>
32
+    <!--_footer 作为公共模版分离出去-->
33
+    <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
34
+    <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
35
+    <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
36
+    <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
37
+    <!--/_footer 作为公共模版分离出去-->
38
+
39
+    <!--请在下方写此页面业务相关的脚本-->
40
+    <script type="text/javascript">
41
+        $(function(){
42
+            setTimeout("$('#error').hide()",3000);
43
+        });
44
+        /*返回*/
45
+        function return_index(){
46
+            location.href='/admin/admin/teamindex';
47
+        }
48
+    </script>
49
+    </body>
50
+@endsection

+ 83 - 0
resources/views/deposit/index.blade.php

@@ -0,0 +1,83 @@
1
+@extends('admin/master')
2
+@section('content')
3
+    <body>
4
+    @if(session('info'))
5
+        <div class="Huialert Huialert-info" onclick="$(this).remove()" id="info">
6
+            {{session('info')}}
7
+        </div>
8
+    @endif
9
+    <div class="page-container">
10
+        <div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"> <a class="btn btn-primary radius" onclick="admin_add('新增', {{$phone}})" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 新增充值记录</a> <a class="btn btn-primary radius" href="/admin/deposit/customerList"> 返回</a></span> </div>
11
+        <div class="mt-20">
12
+            <table class="table table-border table-bordered table-bg table-hover table-sort">
13
+                <thead>
14
+                <tr class="text-c">
15
+                    {{--<th width="25"><input type="checkbox" name="" value=""></th>--}}
16
+                    <th width="10%">账号</th>                   
17
+                    <th width="10%">支付金额</th>
18
+                    <th width="10%">使用套餐</th>
19
+                    <th width="10%">实充金额</th>
20
+                    <th width="10%">充值时间</th>
21
+                </tr>
22
+                </thead>
23
+                <tbody>
24
+                @if($result)
25
+                @foreach($result as $a)
26
+                    <tr class="text-c">
27
+                        {{--<td><input name="" type="checkbox" value=""></td>--}}
28
+                        <td class="text-c">{{$a['phone']}}</td>
29
+                        <td class="text-c">{{$a['pay_amount']}}</td>
30
+                        <td class="text-c">{{$a['note']}}</td>
31
+                        <td class="text-c">{{$a['deposit_amount']}}</td>
32
+                        <td class="text-c">{{$a['pay_time']}}</td>
33
+                        
34
+                    </tr>
35
+                @endforeach
36
+                @endif
37
+                </tbody>
38
+            </table>
39
+        </div>
40
+        <div id="page" class="page_div"></div>
41
+    </div>
42
+
43
+    <!--_footer 作为公共模版分离出去-->
44
+    <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
45
+    <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
46
+    <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
47
+    <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
48
+    <script type="text/javascript" src="/admin/lib/page/paging.js"></script>
49
+    <!--/_footer 作为公共模版分离出去-->
50
+    <!--/_footer 作为公共模版分离出去-->
51
+
52
+    <script type="text/javascript">
53
+        $(function(){
54
+            setTimeout("$('#info').hide()",3000);
55
+        });
56
+        /*管理员-添加*/
57
+        function admin_add(title, phone){
58
+            location.href = '/admin/deposit/create?phone='+phone;
59
+        }
60
+        /*管理员-编辑*/
61
+        function admin_edit(title,id){
62
+            location.href = "/admin/admin/teamedit/"+id;
63
+        }
64
+
65
+        function depositlist(title,phone){
66
+            location.href = '/admin/deposit/index?phone='+phone;
67
+        }
68
+
69
+
70
+        $("#page").paging({ 
71
+            pageNo:{{$page}},
72
+            totalPage: {{$pages}},
73
+            totalSize: {{$count}},
74
+            callback: function(num) {
75
+                var phone = '{{$phone}}'
76
+                location.href='index?page='+num+'&phone='+phone;
77
+            }
78
+        })
79
+
80
+    </script>
81
+    </body>
82
+
83
+@endsection