wesley 6 years ago
parent
commit
54b58f9daf

+ 15 - 6
app/Http/Controllers/Admin/Call/RecordsController.php

xqd xqd
@@ -30,15 +30,24 @@ class RecordsController extends Controller
      */
     function index(Request $request)
     {
-        $search['keyword'] = $request->input('keyword');
-        $query = $this->repository->pushCriteria(new MultiWhere($search));
+        $search = $request->all();
 
+        //dd($search);
+        $order = array();
         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']));
+            $order[$request['sort_field']] = $request['sort_field_by'];
         } else {
-            $query = $query->pushCriteria(new OrderBy('id', 'DESC'));
+            $order['id'] = 'DESC';
+        }
+
+        $list = $this->repository->searchRecords($search, $order);
+
+        if ($request->ajax()) {
+            $view = view('admin.call.records.data', compact('list'))->render();
+
+            return response()->json(['html' => $view]);
+
         }
-        $list = $query->paginate(16);
         return view('admin.call.records.index', compact('list'));
     }
 
@@ -104,7 +113,7 @@ class RecordsController extends Controller
         $data = $this->repository->find(request('id'));
         $list = $data->process();
 
-        return view('admin.call.records.view', compact('data','list'));
+        return view('admin.call.records.view', compact('data', 'list'));
     }
 
 

+ 31 - 5
app/Http/Controllers/Admin/User/ThreadsController.php

xqd
@@ -34,13 +34,39 @@ class ThreadsController extends Controller
     function index(Request $request)
     {
         $user_id = \Auth::guard('admin')->user()->id;
+        $search = $request->all();
+
         $search['keyword'] = $request->input('keyword');
+        if(is_numeric($search['keyword'])){
+            $list = UserThreadsModel::whereHas('contact', function ($query) use ($search) {
+                $query->where('phone', 'like', '%' . $search['keyword'] . '%');
+            })->where('ower_id',$user_id)->orderBy('updated_at','desc');
+
+        }else{
+            $list = UserThreadsModel::whereHas('company', function ($query) use ($search) {
+                $query->where('companyName', 'like', '%' . $search['keyword'] . '%')
+                    ->orWhere('regNo', 'like', '%' . $search['keyword'] . '%')
+                    ->orWhere('companyName', 'like', '%' . $search['keyword'] . '%');
+            })->where('ower_id',$user_id)->orderBy('updated_at','desc');
+        }
+
+        if(isset($search['process']) && $search['process'] ==1 ){
+            $list = $list->has('progress');
+        }
+
+        if(isset($search['process']) && $search['process'] == 2){
+            $list = $list->has('progress','=',0);
+        }
 
-        $list = UserThreadsModel::whereHas('company', function ($query) use ($search) {
-            $query->where('companyName', 'like', '%' . $search['keyword'] . '%')
-                ->orWhere('regNo', 'like', '%' . $search['keyword'] . '%')
-                ->orWhere('companyName', 'like', '%' . $search['keyword'] . '%');
-        })->where('ower_id',$user_id)->orderBy('updated_at','desc')->paginate(16);
+
+        $list =  $list->paginate(16);
+
+        if ($request->ajax()) {
+            $view = view('admin.user.threads.data', compact('list'))->render();
+
+            return response()->json(['html' => $view]);
+
+        }
 
         return view('admin.user.threads.index', compact('list'));
     }

+ 3 - 2
app/Models/CallRecordsModel.php

xqd
@@ -46,8 +46,9 @@ class CallRecordsModel extends BaseModel
         'call_id'
     ];
 
-    public function process(){
-        return CallRecordsProcessModel::where('call_id',$this->call_id)->where('ip',$this->ip)->get();
+    public function process()
+    {
+        return CallRecordsProcessModel::where('call_id', $this->call_id)->where('ip', $this->ip)->get();
     }
 
 }

+ 18 - 15
app/Repositories/Call/Records/Criteria/MultiWhere.php

xqd xqd
@@ -1,9 +1,12 @@
 <?php
+
 namespace App\Repositories\Call\Records\Criteria;
+
 use App\Repositories\Base\Criteria;
 use App\Repositories\Contracts\RepositoryInterface as Repository;
 
-class MultiWhere extends Criteria {
+class MultiWhere extends Criteria
+{
 
     private $search = [];
 
@@ -18,22 +21,22 @@ class MultiWhere extends Criteria {
     }
 
     /**
-    * @param $model
-    * @param RepositoryInterface $repository
-    * @return mixed
-    */
+     * @param $model
+     * @param RepositoryInterface $repository
+     * @return mixed
+     */
     public function apply($model, Repository $repository)
     {
-          if(isset($this->search['keyword']) && $this->search['keyword']) {
-                                    $model = $model->where('id','like','%'.$this->search['keyword'].'%')
- ->orWhere('phone','like','%'.$this->search['keyword'].'%')
- ->orWhere('start_time','like','%'.$this->search['keyword'].'%')
- ->orWhere('end_time','like','%'.$this->search['keyword'].'%')
- ->orWhere('record_path','like','%'.$this->search['keyword'].'%')
- ->orWhere('hangup_dispostion','like','%'.$this->search['keyword'].'%')
- ->orWhere('ip','like','%'.$this->search['keyword'].'%')
-;}
-         return $model;
+        if (isset($this->search['keyword']) && $this->search['keyword']) {
+            $model = $model->where('id', 'like', '%' . $this->search['keyword'] . '%')
+                ->orWhere('phone', 'like', '%' . $this->search['keyword'] . '%')
+                ->orWhere('start_time', 'like', '%' . $this->search['keyword'] . '%')
+                ->orWhere('end_time', 'like', '%' . $this->search['keyword'] . '%')
+                ->orWhere('record_path', 'like', '%' . $this->search['keyword'] . '%')
+                ->orWhere('hangup_dispostion', 'like', '%' . $this->search['keyword'] . '%')
+                ->orWhere('ip', 'like', '%' . $this->search['keyword'] . '%');
+        }
+        return $model;
     }
 
 }

+ 50 - 6
app/Repositories/Call/RecordsRepository.php

xqd
@@ -1,21 +1,65 @@
 <?php
 /**
  *   通话纪录
- *  @author  system
- *  @version    1.0
- *  @date 2018-11-27 03:15:47
+ * @author  system
+ * @version    1.0
+ * @date 2018-11-27 03:15:47
  *
  */
+
 namespace App\Repositories\Call;
 
 use App\Repositories\Base\Repository;
 
 
-class RecordsRepository extends Repository {
+class RecordsRepository extends Repository
+{
 
-    public function model() {
+    public function model()
+    {
         return \App\Models\CallRecordsModel::class;
     }
 
-    
+    public function searchRecords(array $search, array $orderby = ['id' => 'desc'], $pagesize = 10)
+    {
+        $currentQuery = $this->model;
+        /*企业名称*/
+        if (isset($search['ip']) && !empty($search['ip'])) {
+            $keywords = $search['ip'];
+            \Log::info($search['ip']);
+            $currentQuery = $currentQuery->where(function ($query) use ($keywords) {
+                $query->where('ip', $keywords);
+            });
+        };
+        if (isset($search['term_status']) && $search['term_status'] == 200) {
+            $keywords = $search['term_status'];
+            $currentQuery = $currentQuery->where(function ($query) use ($keywords) {
+                $query->where('term_status', $keywords);
+            });
+        };
+
+        if (isset($search['term_status']) && $search['term_status'] != 200) {
+            $keywords = $search['term_status'];
+            $currentQuery = $currentQuery->where(function ($query) use ($keywords) {
+                $query->where('term_status', '!=', 200);
+            });
+        };
+
+        if (isset($search['phone']) && !empty($search['phone'])) {
+            $keywords = '%' . $search['phone'] . '%';
+            $currentQuery = $currentQuery->where(function ($query) use ($keywords) {
+                $query->where('phone', 'like', $keywords);
+            });
+        };
+
+
+        if ($orderby && is_array($orderby)) {
+            foreach ($orderby AS $field => $value) {
+                $currentQuery = $currentQuery->orderBy($field, $value);
+            }
+        };
+        $currentQuery = $currentQuery->paginate($pagesize);
+        return $currentQuery;
+    }
+
 }

+ 59 - 0
resources/views/admin/call/records/data.blade.php

xqd
@@ -0,0 +1,59 @@
+<table class="table table-striped table-bordered table-hover dataTables-example dataTable">
+    <thead>
+    <tr>
+        <th><label><input type="checkbox" id="checkAll"> 全选</label>
+        </th>
+        <th class="sorting" data-sort="id"> ID</th>
+        <th class="sorting" data-sort="phone"> 电话号码</th>
+        <th class="sorting" data-sort="start_time"> 拨打时间</th>
+        <th class="sorting" data-sort="end_time"> 结束时间</th>
+        <th class="sorting" data-sort="intention"> 意向</th>
+        <th class="sorting" data-sort="term_status"> 接通状态</th>
+        <th class="sorting" data-sort="hangup_dispostion"> 挂断原因</th>
+        <th class="sorting" data-sort="ip"> 拨打IP</th>
+        <th width="22%">相关操作</th>
+    </tr>
+    </thead>
+    <tbody>
+    @if(isset($list))
+        @foreach($list as $key => $item)
+            <tr>
+                <td>
+                    <label><input class="contacts" name='contact_phone[]' type="checkbox"
+                                  value="{{ $item->phone }}"></label>
+                </td>
+                <td>{{ $item->id }}</td>
+                <td>{{ $item->phone }}</td>
+                <td>{{ $item->start_time }}</td>
+                <td>{{ $item->end_time }}</td>
+                <td>{{ $item->intention }}</td>
+                <td>{{ $item->term_status }}</td>
+                <td>{{ $item->hangup_dispostion }}</td>
+                <td>{{ $item->ip }}</td>
+                <td>
+
+                    @if(role('Call/Records/view'))
+                        <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Call/Records/view',['id'=>$item->id])}}'});"
+                                class="btn btn-sm 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>

+ 50 - 85
resources/views/admin/call/records/index.blade.php

xqd xqd xqd
@@ -13,20 +13,7 @@
                 </div>
                 <div class="ibox-content">
                     <div class="form-group">
-                        <div class="row">
-                            <div class="col-sm-4">
-                                <form method="GET" action="" accept-charset="UTF-8">
-                                    <div class="input-group">
-                                        <input type="text" class="form-control" value="{{Request::get('keyword')}}"
-                                               placeholder="请输入电话号码"
-                                               name="keyword">
-                                        <span class="input-group-append">
-                                                <button type="submit" class="btn btn-primary"
-                                                        style="height: 100%">搜索</button>
-                                            </span>
-                                    </div>
-                                </form>
-                            </div>
+
                             @if(role('Call/Records/addCallList'))
                                 <div class="col-sm-8 pull-right">
                                     <span id="addCallList" class="btn btn-primary pull-right fa fa-phone"
@@ -41,83 +28,50 @@
                         </div>
                     </div>
 
+                    {{-- 过滤条件 --}}
                     <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
-                        <thead>
                         <tr>
-                            <th><label><input type="checkbox" id="checkAll"> 全选</label>
+                            <th> 过滤条件</th>
+                            <form method="GET" action="" accept-charset="UTF-8" id="filter_records">
+                                <th>
+                                    <select name="ip" class="form-control filter_records">
+                                        <option value="">拨打IP</option>
+                                        <option value="172.31.20.133">172.31.20.133</option>
+                                        <option value="172.31.20.134">172.31.20.134</option>
+                                        <option value="172.31.20.135">172.31.20.135</option>
+                                        <option value="172.31.20.136">172.31.20.136</option>
+                                        <option value="172.31.20.137">172.31.20.137</option>
+                                    </select>
+                                </th>
+
+                                <th>
+                                    <select name="term_status" class="form-control filter_records">
+                                        <option value="">接听状态</option>
+                                        <option value="200">已接通</option>
+                                        <option value="408">未接通</option>
+                                    </select>
+                                </th>
+                            </form>
+                            <th>
+                                <form method="GET" action="" accept-charset="UTF-8">
+                                    <div class="input-group">
+                                        <input type="text" class="form-control" value="{{Request::get('phone')}}"
+                                               placeholder="请输入电话号码"
+                                               name="phone">
+                                        <span class="input-group-append">
+                                                <button type="submit" class="btn btn-sm btn-default"
+                                                        style="height: 100%">搜索</button>
+                                            </span>
+                                    </div>
+                                </form>
                             </th>
-                            <th class="sorting" data-sort="id"> ID</th>
-                            <th class="sorting" data-sort="phone"> 电话号码</th>
-                            <th class="sorting" data-sort="start_time"> 拨打时间</th>
-                            <th class="sorting" data-sort="end_time"> 结束时间</th>
-                            <th class="sorting" data-sort="record_path"> 录音地址</th>
-                            <th class="sorting" data-sort="intention"> 意向</th>
-                            <th class="sorting" data-sort="term_status"> 接通状态</th>
-                            <th class="sorting" data-sort="hangup_dispostion"> 挂断原因</th>
-                            <th class="sorting" data-sort="ip"> 拨打IP</th>
-                            <th width="22%">相关操作</th>
                         </tr>
-                        </thead>
-                        <tbody>
-                        @if(isset($list))
-                            @foreach($list as $key => $item)
-                                <tr>
-                                    <td>
-                                        <label><input class="contacts" name='contact_phone[]' type="checkbox"
-                                                      value="{{ $item->phone }}"></label>
-                                    </td>
-                                    <td>{{ $item->id }}</td>
-                                    <td>{{ $item->phone }}</td>
-                                    <td>{{ $item->start_time }}</td>
-                                    <td>{{ $item->end_time }}</td>
-                                    <td>
-                                        <audio src="http://{{ $item->record_path }}" controls="controls">
-                                        </audio>
-                                    </td>
-                                    <td>{{ $item->intention }}</td>
-                                    <td>{{ $item->term_status }}</td>
-                                    <td>{{ $item->hangup_dispostion }}</td>
-                                    <td>{{ $item->ip }}</td>
-                                    <td>
-                                        {{--@if(role('Call/Records/update'))--}}
-                                        {{--<button class="btn btn-sm btn-success"--}}
-                                        {{--onclick="window.location.href='{{ U('Call/Records/update',['id'=>$item->id])}}' ">--}}
-                                        {{--修改--}}
-                                        {{--</button>--}}
-
-                                        {{--@endif--}}
-
-                                        {{--@if(role('Call/Records/destroy'))--}}
-                                        {{--<a class="btn btn-sm btn-danger"--}}
-                                        {{--href="{{ U('Call/Records/destroy',['id'=>$item->id])}}"--}}
-                                        {{--onclick="return confirm('你确定执行删除操作?');">删除</a>--}}
-                                        {{--@endif--}}
-
-                                        @if(role('Call/Records/view'))
-                                            <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Call/Records/view',['id'=>$item->id])}}'});"
-                                                    class="btn btn-sm 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 id="records-list">
+                        @include('admin.call.records.data')
                     </div>
+
                 </div>
             </div>
         </div>
@@ -179,5 +133,16 @@
 
             console.log(contact_phones)
         })
+
+        /*通话纪录筛选*/
+        $('.filter_records').change(function () {
+            data = $('#filter_records').serialize()
+            $.ajax({
+                type: 'get',
+                data: data,
+            }).done(function (data) {
+                $('#records-list').html(data.html)
+            })
+        })
     </script>
 @endsection

+ 74 - 0
resources/views/admin/user/threads/data.blade.php

xqd
@@ -0,0 +1,74 @@
+<table class="table table-striped table-bordered table-hover dataTables-example dataTable">
+    <thead>
+    <tr>
+        <th><label><input type="checkbox" id="checkAll"> 全选</label>
+        </th>
+        <th class="sorting" data-sort="id"> ID</th>
+        <th class="sorting"> 联系方式</th>
+        <th class="sorting" data-sort="ower_id"> 线索拥有者</th>
+        <th class="sorting">企业名称</th>
+        <th class="sorting">企业网址</th>
+        <th class="sorting">注册资本</th>
+        <th class="sorting"> 最新跟进</th>
+        <th class="sorting" data-sort="created_at"> 领取时间</th>
+        <th width="22%">相关操作</th>
+    </tr>
+    </thead>
+    <tbody>
+    @if(isset($list))
+        @foreach($list as $key => $item)
+            <tr>
+
+                <td>
+                    <label><input class="contacts" name='contact_id[]' type="checkbox"
+                                  value="{{ $item->id }}"></label>
+                </td>
+                <td>{{ $item->id }}</td>
+                <td>{{ $item->contact?$item->contact->phone:'暂无联系人信息' }}</td>
+                <td>{{ $item->ower->real_name }}</td>
+                <td>
+                    <a href="{{ U('Company/Info/view',['id'=> $item->company->id]) }}"> {{ $item->company->companyName }} </a>
+                </td>
+                <td><a href="http://{{ $item->company->website }}"
+                       target="_blank">{{ $item->company->website }}</a></td>
+                <td>{{ $item->company->regCapital }}</td>
+                <td>{{ $item->latestProgress() }}</td>
+                <td>{{ $item->created_at }}</td>
+                <td>
+                    @if(role('User/Threads/update'))
+                        <button onclick="layer.open({type: 2,area: ['25%', '60%'],content: '{{ U('User/Threads/update',['id'=>$item->id])}}'});"
+                                class="btn btn-sm btn-primary ">跟进
+                        </button>
+
+                    @endif
+
+                    @if(role('User/Threads/destroy'))
+                        <a class="btn btn-sm btn-danger"
+                           href="{{ U('User/Threads/destroy',['id'=>$item->id])}}"
+                           onclick="return confirm('你确定放弃该线索?');">放弃</a>
+                    @endif
+
+                    @if(role('User/Threads/view'))
+
+                    @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>

+ 78 - 90
resources/views/admin/user/threads/index.blade.php

xqd xqd
@@ -13,107 +13,82 @@
                 </div>
                 <div class="ibox-content">
                     <div class="form-group">
-                        <div class="row">
-                            <div class="col-sm-4">
-                                <form method="GET" action="" accept-charset="UTF-8">
-                                    <div class="input-group">
-                                        <input type="text" class="form-control" value="{{Request::get('keyword')}}"
-                                               placeholder="请输入关键词"
-                                               name="keyword">
-                                        <span class="input-group-append">
-                                                <button type="submit" class="btn btn-primary"
-                                                        style="height: 100%">搜索</button>
-                                            </span>
-                                    </div>
-                                </form>
-                            </div>
 
-                            @if(role('User/Threads/addCallList'))
-                                <div class="col-sm-8 pull-right">
+                        @if(role('User/Threads/addCallList'))
+                            <div class="col-sm-8 pull-right">
                                     <span id="addCallList" class="btn btn-primary pull-right fa fa-phone"
                                           style="display: none">添加到电话列表</span>
-                                </div>
-                            @endif
-                        </div>
+                            </div>
+                        @endif
                     </div>
+                </div>
 
-                    <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
-                        <thead>
-                        <tr>
-                            <th><label><input type="checkbox" id="checkAll"> 全选</label>
+                {{--添加过滤条件--}}
+                <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
+                    <tr>
+                        <th> 过滤条件</th>
+                        <form method="GET" action="" accept-charset="UTF-8" id="filter_threads">
+                            <th>
+                                <select name="process" class="form-control filter_threads">
+                                    <option value="">有无跟进</option>
+                                    <option value="1">有</option>
+                                    <option value="2">无</option>
+                                </select>
                             </th>
-                            <th class="sorting" data-sort="id"> ID</th>
-                            <th class="sorting"> 联系方式</th>
-                            <th class="sorting" data-sort="ower_id"> 线索拥有者</th>
-                            <th class="sorting">企业名称</th>
-                            <th class="sorting">企业网址</th>
-                            <th class="sorting">注册资本</th>
-                            <th class="sorting"> 最新跟进</th>
-                            <th class="sorting" data-sort="created_at"> 领取时间</th>
-                            <th width="22%">相关操作</th>
-                        </tr>
-                        </thead>
-                        <tbody>
-                        @if(isset($list))
-                            @foreach($list as $key => $item)
-                                <tr>
-
-                                    <td>
-                                        <label><input class="contacts" name='contact_id[]' type="checkbox"
-                                                      value="{{ $item->id }}"></label>
-                                    </td>
-                                    <td>{{ $item->id }}</td>
-                                    <td>{{ $item->contact?$item->contact->phone:'暂无联系人信息' }}</td>
-                                    <td>{{ $item->ower->real_name }}</td>
-                                    <td>
-                                        <a href="{{ U('Company/Info/view',['id'=> $item->company->id]) }}"> {{ $item->company->companyName }} </a>
-                                    </td>
-                                    <td><a href="http://{{ $item->company->website }}"
-                                           target="_blank">{{ $item->company->website }}</a></td>
-                                    <td>{{ $item->company->regCapital }}</td>
-                                    <td>{{ $item->latestProgress() }}</td>
-                                    <td>{{ $item->created_at }}</td>
-                                    <td>
-                                        @if(role('User/Threads/update'))
-                                            <button onclick="layer.open({type: 2,area: ['25%', '60%'],content: '{{ U('User/Threads/update',['id'=>$item->id])}}'});"
-                                                    class="btn btn-sm btn-primary ">跟进
-                                            </button>
-
-                                        @endif
-
-                                        @if(role('User/Threads/destroy'))
-                                            <a class="btn btn-sm btn-danger"
-                                               href="{{ U('User/Threads/destroy',['id'=>$item->id])}}"
-                                               onclick="return confirm('你确定放弃该线索?');">放弃</a>
-                                        @endif
-
-                                        @if(role('User/Threads/view'))
-
-                                        @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>
+                            {{--<th style="width: 40%">--}}
+                            {{--<div class="row">--}}
+
+                            {{--<div class="col-sm-5" id="data_1">--}}
+
+                            {{--<div class="input-group date">--}}
+                            {{--<span class="input-group-addon">--}}
+                            {{--<i class="fa fa-calendar"></i></span>--}}
+                            {{--<input type="text" id="start" class="form-control" placeholder="领取日期"--}}
+                            {{--name="start"--}}
+                            {{--value="{{Request::get('start') ? : ''}}">--}}
+                            {{--</div>--}}
+                            {{--</div>--}}
+                            {{--_--}}
+                            {{--<div class="col-sm-5" id="data_2">--}}
+                            {{--<div class="input-group date">--}}
+                            {{--<span class="input-group-addon">--}}
+                            {{--<i class="fa fa-calendar"></i></span>--}}
+                            {{--<input type="text" id="end" class="form-control" placeholder="领取日期"--}}
+                            {{--name="end"--}}
+                            {{--value="{{Request::get('end') ? : ''}}">--}}
+                            {{--</div>--}}
+                            {{--</div>--}}
+                            {{--</div>--}}
+
+                            {{--</th>--}}
+
+
+                            <th>
+
+                                <div class="input-group">
+                                    <input type="text" class="form-control" value="{{Request::get('keyword')}}"
+                                           placeholder="请输入企业名称"
+                                           name="keyword">
+                                    <span class="input-group-append">
+                                                <button type="submit" class="btn btn-sm btn-default"
+                                                        style="height: 100%">搜索</button>
+                                            </span>
+                                </div>
+
+                            </th>
+                        </form>
+                    </tr>
+                </table>
+
+                <div id="threads-list">
+                    @include('admin.user.threads.data')
+
                 </div>
             </div>
         </div>
     </div>
+    </div>
 @endsection
 
 @section('js')
@@ -170,5 +145,18 @@
 
             console.log(contact_ids)
         })
+
+        /*线索筛选*/
+        $('.filter_threads').change(function () {
+            data = $('#filter_threads').serialize()
+            console.log(data)
+            $.ajax({
+                type: 'get',
+                data: data,
+            }).done(function (data) {
+                console.log(data)
+                $('#threads-list').html(data.html)
+            })
+        })
     </script>
 @endsection