wesley 6 年之前
父節點
當前提交
3d6da10d7b

+ 4 - 2
app/Http/Controllers/Admin/Call/RecordsController.php

xqd xqd
@@ -36,7 +36,7 @@ class RecordsController 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']));
         } else {
-            $query = $query->pushCriteria(new OrderBy('updated_at', 'DESC'));
+            $query = $query->pushCriteria(new OrderBy('id', 'DESC'));
         }
         $list = $query->paginate(16);
         return view('admin.call.records.index', compact('list'));
@@ -102,7 +102,9 @@ class RecordsController extends Controller
     public function view(Request $request)
     {
         $data = $this->repository->find(request('id'));
-        return view('admin.call.records.view', compact('data'));
+        $list = $data->process();
+
+        return view('admin.call.records.view', compact('data','list'));
     }
 
 

+ 4 - 0
app/Models/CallRecordsModel.php

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

+ 75 - 56
resources/views/admin/call/records/edit.blade.php

xqd xqd
@@ -25,7 +25,8 @@
                     @if(role('Call/Records/index'))
                         <div class="row">
                             <div class="col-sm-10 pull-right">
-                                <a href="{{ U('Call/Records/index')}}" class="btn btn-sm btn-primary pull-right">返回列表</a>
+                                <a href="{{ U('Call/Records/index')}}"
+                                   class="btn btn-sm btn-primary pull-right">返回列表</a>
                             </div>
                         </div>
                     @endif
@@ -35,61 +36,79 @@
                             <form name="form_product" id="form-validation" action=""
                                   class="form-horizontal form-validation" accept-charset="UTF-8" method="post">
 
-                                    
-                <div class="form-group row">
-                                    
-                 <label class="col-form-label col-sm-3">电话号码</label>
-                                    
-                   <div class="col-sm-9">
-                     <input id="data_phone" name="data[phone]" class="form-control" value="{{ $data['phone'] or ''}}" required="" aria-required="true"  placeholder=""> 
-                    </div>
-                                
-                </div>    
-                <div class="form-group row">
-                                    
-                 <label class="col-form-label col-sm-3">拨打时间</label>
-                                    
-                   <div class="col-sm-9">
-  <input name="data[start_time]" class="form-control laydate-icon help-block m-b-none" style="width:200px; height:34px;" value="{{ $data['start_time'] or ''}}" placeholder="拨打时间" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" aria-invalid="false"> 
-                    </div>
-                                
-                </div>    
-                <div class="form-group row">
-                                    
-                 <label class="col-form-label col-sm-3">结束时间</label>
-                                    
-                   <div class="col-sm-9">
-  <input name="data[end_time]" class="form-control laydate-icon help-block m-b-none" style="width:200px; height:34px;" value="{{ $data['end_time'] or ''}}" placeholder="结束时间" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" aria-invalid="false"> 
-                    </div>
-                                
-                </div>    
-                <div class="form-group row">
-                                    
-                 <label class="col-form-label col-sm-3">录音地址</label>
-                                    
-                   <div class="col-sm-9">
-                     <input id="data_record_path" name="data[record_path]" class="form-control" value="{{ $data['record_path'] or ''}}" required="" aria-required="true"  placeholder=""> 
-                    </div>
-                                
-                </div>    
-                <div class="form-group row">
-                                    
-                 <label class="col-form-label col-sm-3">挂断原因</label>
-                                    
-                   <div class="col-sm-9">
-                     <input id="data_hangup_dispostion" name="data[hangup_dispostion]" class="form-control" value="{{ $data['hangup_dispostion'] or ''}}" required="" aria-required="true"  placeholder=""> 
-                    </div>
-                                
-                </div>    
-                <div class="form-group row">
-                                    
-                 <label class="col-form-label col-sm-3">拨打IP</label>
-                                    
-                   <div class="col-sm-9">
-                     <input id="data_ip" name="data[ip]" class="form-control" value="{{ $data['ip'] or ''}}" required="" aria-required="true"  placeholder=""> 
-                    </div>
-                                
-                </div>
+
+                                <div class="form-group row">
+
+                                    <label class="col-form-label col-sm-3">电话号码</label>
+
+                                    <div class="col-sm-9">
+                                        <input id="data_phone" name="data[phone]" class="form-control"
+                                               value="{{ $data['phone'] or ''}}" required="" aria-required="true"
+                                               placeholder="">
+                                    </div>
+
+                                </div>
+                                <div class="form-group row">
+
+                                    <label class="col-form-label col-sm-3">拨打时间</label>
+
+                                    <div class="col-sm-9">
+                                        <input name="data[start_time]"
+                                               class="form-control laydate-icon help-block m-b-none"
+                                               style="width:200px; height:34px;" value="{{ $data['start_time'] or ''}}"
+                                               placeholder="拨打时间"
+                                               onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
+                                               aria-invalid="false">
+                                    </div>
+
+                                </div>
+                                <div class="form-group row">
+
+                                    <label class="col-form-label col-sm-3">结束时间</label>
+
+                                    <div class="col-sm-9">
+                                        <input name="data[end_time]"
+                                               class="form-control laydate-icon help-block m-b-none"
+                                               style="width:200px; height:34px;" value="{{ $data['end_time'] or ''}}"
+                                               placeholder="结束时间"
+                                               onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
+                                               aria-invalid="false">
+                                    </div>
+
+                                </div>
+                                <div class="form-group row">
+
+                                    <label class="col-form-label col-sm-3">录音地址</label>
+
+                                    <div class="col-sm-9">
+                                        <input id="data_record_path" name="data[record_path]" class="form-control"
+                                               value="{{ $data['record_path'] or ''}}" required="" aria-required="true"
+                                               placeholder="">
+                                    </div>
+
+                                </div>
+                                <div class="form-group row">
+
+                                    <label class="col-form-label col-sm-3">挂断原因</label>
+
+                                    <div class="col-sm-9">
+                                        <input id="data_hangup_dispostion" name="data[hangup_dispostion]"
+                                               class="form-control" value="{{ $data['hangup_dispostion'] or ''}}"
+                                               required="" aria-required="true" placeholder="">
+                                    </div>
+
+                                </div>
+                                <div class="form-group row">
+
+                                    <label class="col-form-label col-sm-3">拨打IP</label>
+
+                                    <div class="col-sm-9">
+                                        <input id="data_ip" name="data[ip]" class="form-control"
+                                               value="{{ $data['ip'] or ''}}" required="" aria-required="true"
+                                               placeholder="">
+                                    </div>
+
+                                </div>
 
                                 <div class="form-group row">
                                     <label class="col-form-label col-sm-3">&nbsp;</label>

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

xqd xqd xqd
@@ -55,7 +55,7 @@
                             <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>--}}
+                            <th width="22%">相关操作</th>
                         </tr>
                         </thead>
                         <tbody>
@@ -78,7 +78,7 @@
                                     <td>{{ $item->term_status }}</td>
                                     <td>{{ $item->hangup_dispostion }}</td>
                                     <td>{{ $item->ip }}</td>
-                                    {{--<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])}}' ">--}}
@@ -93,12 +93,12 @@
                                         {{--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>--}}
+                                        @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

+ 49 - 44
resources/views/admin/call/records/view.blade.php

xqd
@@ -3,51 +3,56 @@
 @section('content')
     <div class="row">
         <div class="ibox-content">
-            <div class="list-group">
-                                     
-               <div class="list-group-item">
-                                                  
-                   <h3 class="list-group-item-heading">电话号码</h3>
-                                                   
-                   <p class="list-group-item-text"> {{ $data['phone'] or ''}}</p>
-                                                 
-               </div>                     
-               <div class="list-group-item">
-                                                  
-                   <h3 class="list-group-item-heading">拨打时间</h3>
-                                                   
-                   <p class="list-group-item-text"> {{ $data['start_time'] or ''}}</p>
-                                                 
-               </div>                     
-               <div class="list-group-item">
-                                                  
-                   <h3 class="list-group-item-heading">结束时间</h3>
-                                                   
-                   <p class="list-group-item-text"> {{ $data['end_time'] or ''}}</p>
-                                                 
-               </div>                     
-               <div class="list-group-item">
-                                                  
-                   <h3 class="list-group-item-heading">录音地址</h3>
-                                                   
-                   <p class="list-group-item-text"> {{ $data['record_path'] or ''}}</p>
-                                                 
-               </div>                     
-               <div class="list-group-item">
-                                                  
-                   <h3 class="list-group-item-heading">挂断原因</h3>
-                                                   
-                   <p class="list-group-item-text"> {{ $data['hangup_dispostion'] or ''}}</p>
-                                                 
-               </div>                     
-               <div class="list-group-item">
-                                                  
-                   <h3 class="list-group-item-heading">拨打IP</h3>
-                                                   
-                   <p class="list-group-item-text"> {{ $data['ip'] or ''}}</p>
-                                                 
-               </div>
+            <div class="form-group">
+                <div class="row">
+                    <div class="col-sm-4">
+
+                        <div class="form-group row">
+
+                            <label class="col-form-label col-sm-3">完整录音:</label>
+
+                            <div class="col-sm-9">
+                                <audio src="http://{{ $data->record_path }}" controls="controls">
+                                </audio>
+                            </div>
+
+                        </div>
+                    </div>
+                </div>
             </div>
+
+            <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
+                <thead>
+                <tr>
+                    <th> ID</th>
+                    <th> 呼叫标识</th>
+                    <th> 机器人</th>
+                    <th> 被叫用户</th>
+                    <th> 节点名字</th>
+                    <th> 纪录时间</th>
+                    <th> 录音地址</th>
+
+                </tr>
+                </thead>
+                <tbody>
+                @if(isset($list))
+                    @foreach($list as $key => $item)
+                        <tr>
+                            <td> {{ $item->id  }}</td>
+                            <td> {{ $item->call_id  }}</td>
+                            <td> {{ $item->ai_speak  }}</td>
+                            <td> {{ $item->people_speak  }}</td>
+                            <td> {{ $item->node_name  }}</td>
+                            <td> {{ $item->flow_time  }}</td>
+                            <td> @if($item->voice_path)<audio src="http://{{ $item->voice_path }}" controls="controls">
+                                </audio> @endif</td>
+
+                        </tr>
+                    @endforeach
+                @endif
+
+                </tbody>
+            </table>
         </div>
     </div>
 @endsection