wesley.chen 7 éve
szülő
commit
af1709ecdf

+ 1 - 1
app/Http/Controllers/Admin/Cutoff/ScoreController.php

xqd
@@ -30,7 +30,7 @@ class ScoreController extends Controller
         }else{
             $query = $query->pushCriteria(new OrderBy('id','DESC'));
         }
-        $list = $query->paginate();
+        $list = $query->paginate(10);
         return view('admin.cutoff.score.index',compact('list'));
     }
 

+ 1 - 1
app/Http/Controllers/Admin/Paid/SettingController.php

xqd
@@ -30,7 +30,7 @@ class SettingController extends Controller
         }else{
             $query = $query->pushCriteria(new OrderBy('id','DESC'));
         }
-        $list = $query->paginate();
+        $list = $query->paginate(10);
         return view('admin.paid.setting.index',compact('list'));
     }
 

+ 1 - 1
app/Http/Controllers/Admin/Query/InfoController.php

xqd
@@ -30,7 +30,7 @@ class InfoController extends Controller
         }else{
             $query = $query->pushCriteria(new OrderBy('id','DESC'));
         }
-        $list = $query->paginate();
+        $list = $query->paginate(10);
         return view('admin.query.info.index',compact('list'));
     }
 

+ 1 - 1
app/Http/Controllers/Admin/User/InfoController.php

xqd
@@ -28,7 +28,7 @@ class InfoController extends Controller
         if(isset($request['sort_field']) && $request['sort_field'] && isset($request['sort_field_by'])) {
             $query = $query->pushCriteria(new OrderBy($request['sort_field'],$request['sort_field_by']));
         }
-        $list = $query->paginate();
+        $list = $query->paginate(10);
         return view('admin.user.info.index',compact('list'));
     }
 

+ 18 - 15
app/Models/UserInfoModel.php

xqd
@@ -36,23 +36,26 @@ class UserInfoModel extends Authenticatable
      * @var string
      */
     protected $fillable = [
-        'password',
-        'email',
-        'area',
-        'name',
-        'vip',
-        'level',
-        'idcard',
-        'contact',
-        'prize',
-        'openid',
-        'remember_token',
-        'idcard_positive',
-        'idcard_back',
+   'nickname',
         'username',
-        'real_name',
         'email',
-        'mobile'
+        'mobile',
+        'avatar',
+        'openid',
+        'grade',
+        'cnumber',
+        'class',
+        'refer_id',
+        'code',
+        'paid_end_time',
+        'last_login_time',
+        'has_agreed',
+        'remember_token'
+
     ];
 
+    public function referuser($id){
+        if($id) return (new UserInfoModel)->find($id)->username;
+    }
+
 }

+ 3 - 2
app/Repositories/User/Criteria/MultiWhere.php

xqd
@@ -38,8 +38,9 @@ class MultiWhere extends Criteria {
         if(isset($this->search['keyword']) && ! empty($this->search['keyword'])) {
             $keywords = '%' . $this->search['keyword'] . '%';
             $model = $model->where(function ($query) use ($keywords) {
-                $query->where('id'  , 'like', $keywords)
-                    ->orwhere('mobile', 'like', $keywords);
+                $query->where('username'  , 'like', $keywords)
+                    ->orwhere('mobile', 'like', $keywords)
+                    ->orwhere('cnumber', 'like', $keywords);
             });
         }
         return $model;

+ 1 - 1
database/migrations/2017_05_30_203526_create_user_info_table.php

xqd
@@ -31,7 +31,7 @@ class CreateUserInfoTable extends Migration
             $table->string('class',64)->nullable()->comment('科类');
             $table->integer('refer_id')->nullable()->comment('推荐人ID');
             $table->string('code',255)->nullable()->comment('推荐码');
-            $table->string('paid_end_timephp', 255)->nullable()->comment('付费查询有效期');
+            $table->string('paid_end_time', 255)->nullable()->comment('付费查询有效期');
             $table->dateTime('last_login_time')->nullable()->comment('最后一次登录时间');
             $table->tinyInteger('has_agreed')->nullable()->comment('是否同意使用说明');
             $table->string('remember_token', 255)->nullable();

+ 68 - 101
resources/views/admin/user/info/index.blade.php

xqd
@@ -1,112 +1,79 @@
-@extends('admin.layout') 
+@extends('admin.layout')
 
 @section('content')
-<div class="wrapper wrapper-content animated fadeInRight">
-	<div class="row">
-		<div class="col-sm-12">
-			<div class="ibox float-e-margins">
-				<div class="ibox-title">
-					<h5>用户管理</h5>
-					<div class="ibox-tools">
-						<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
-						</a>
-					</div>
-				</div>
-				<div class="ibox-content">
-				    <div class="row">
-				        <form method="GET" action="" accept-charset="UTF-8">
+    <div class="wrapper wrapper-content animated fadeInRight">
+        <div class="row">
+            <div class="col-sm-12">
+                <div class="ibox float-e-margins">
+                    <div class="ibox-title">
+                        <h5>用户管理</h5>
+                        <div class="ibox-tools">
+                            <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
+                            </a>
+                        </div>
+                    </div>
+                    <div class="ibox-content">
+                        <div class="row">
+                            <form method="GET" action="" accept-charset="UTF-8">
 
-				        <div class="col-sm-4">
-				            <div class="input-group">
-								<input type="text" value="{{Request::get('keyword')}}"	placeholder="请输入关键词" name="keyword"class="input-sm form-control"> 
-								<span class="input-group-btn">
+                                <div class="col-sm-4">
+                                    <div class="input-group">
+                                        <input type="text" value="{{Request::get('keyword')}}" placeholder="考生姓名/手机/考号"
+                                               name="keyword" class="input-sm form-control">
+                                        <span class="input-group-btn">
 									<button type="submit" class="btn btn-sm btn-primary">搜索</button>
 								</span>
-    						</div>
-				        </div>
-				        </form>
-						@if(role('User/Info/create'))
-    					<div class="col-sm-3 pull-right">
-    					   <a href="{{ U('User/Info/create')}}" class="btn btn-sm btn-primary pull-right">添加</a>
-    					</div>
-						@endif
-					</div>
-					
-					<table class="table table-striped table-bordered table-hover dataTables-example dataTable">
-						<thead>
-    						<tr>
-								
-            <th class="sorting" data-sort="id"> 用户ID </th>
-            <th class="sorting" data-sort="real_name"> 姓名 </th>
-            <th class="sorting" data-sort="email"> EMAIL </th>
-            <th class="sorting" data-sort="mobile"> 手机号 </th>
-            <th class="sorting" data-sort="idcard_back"> 工作类型 </th>
-            <th class="sorting" data-sort="educational"> 学历 </th>
-								<th class="sorting" data-sort="last_login_time"> 最后登陆时间 </th>
+                                    </div>
+                                </div>
+                            </form>
 
-        						<th width="22%">相关操作</th>
-        					</tr>
-						</thead>
-						<tbody>
+                        </div>
 
-						@if(isset($list))
-							@foreach($list as $key => $item)
-								<tr>
-									<td>{{ $item->id }}</td>
-									<td>{{ $item->real_name }}</td>
-									<td>{{ $item->email }}</td>
-									<td>{{ $item->mobile }}</td>
-									<td>{{ dict()->get('user_info','work_type',$item->work_type) }}</td>
-									<td>{{ $item->educational }}</td>
-									<td>{{ $item->last_login_time }}</td>
-									<td>{{ $item->created_at->format('Y-m-d H:i:s') }}</td>
+                        <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
+                            <thead>
+                            <tr>
+                                <th class="sorting" data-sort="username"> 考生姓名</th>
+                                <th class="sorting" data-sort="mobile"> 手机号</th>
+                                <th class="sorting" data-sort="cnumber"> 考号</th>
+                                <th class="sorting" data-sort="grade"> 高考成绩</th>
+                                <th class="sorting" data-sort="refer_id"> 推荐人</th>
+                                <th class="sorting" data-sort="code"> 推荐码</th>
+                            </tr>
+                            </thead>
+                            <tbody>
 
+                            @if(isset($list))
+                                @foreach($list as $key => $item)
+                                    <tr>
+                                        <td>{{ $item->username }}</td>
+                                        <td>{{ $item->mobile }}</td>
+                                        <td>{{ $item->cnumber }}</td>
+                                        <td>{{ $item->grade }}</td>
+                                        <td>{{ $item->referuser($item->refer_id) }}</td>
+                                        <td>{{ $item->code }}</td>
 
-								<td>
-									<div class="btn-group">
-										<button data-toggle="dropdown"
-											class="btn btn-warning btn-sm dropdown-toggle"
-											aria-expanded="false">
-											操作 <span class="caret"></span>
-										</button>
-										<ul class="dropdown-menu">
+                                    </tr>
+                                @endforeach
+                            @endif
 
-
-											@if(role('User/Info/update'))
-											<li><a href="{{ U('User/Info/update',['id'=>$item->id])}}" class="font-bold">修改</a></li>
-											@endif
-
-											@if(role('User/Info/destroy'))
-											<li class="divider"></li>
-											<li><a href="{{ U('User/Info/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');">删除</a></li>
-											@endif
-
-										</ul>
-									</div>
-								@if(role('User/Info/view'))
-										<button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('User/Info/view',['id'=>$item->id])}}'});"  class="btn btn-primary ">查看</button>
-									@endif
-								</td>
-							</tr>
-							@endforeach
-							@endif
-
-						</tbody>
-					</table>
-					<div class="row">
-						<div class="col-sm-6">
-							<div class="dataTables_info" id="DataTables_Table_0_info"
-								role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}条,共{{ $list->lastPage() }}页,总{{ $list->total() }}条。</div>
-						</div>
-						<div class="col-sm-6">
-						<div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
-						{!! $list->setPath('')->appends(Request::all())->render() !!}
-						</div>
-						</div>
-					</div>
-				</div>
-			</div>
-		</div>
-	</div>
-</div>
+                            </tbody>
+                        </table>
+                        <div class="row">
+                            <div class="col-sm-6">
+                                <div class="dataTables_info" id="DataTables_Table_0_info"
+                                     role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}
+                                    条,共{{ $list->lastPage() }}页,总{{ $list->total() }}条。
+                                </div>
+                            </div>
+                            <div class="col-sm-6">
+                                <div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
+                                    {!! $list->setPath('')->appends(Request::all())->render() !!}
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
 @endsection