wesley 6 years ago
parent
commit
d980ceb0c4

+ 19 - 12
app/Models/CallRecordsModel.php

xqd xqd xqd
@@ -1,11 +1,14 @@
 <?php
+
 namespace App\Models;
+
 use App\Models\BaseModel;
+
 /**
- *  @description 通话纪录
- *  @author  system;
- *  @version    1.0
- *  @date 2018-11-27 03:15:47
+ * @description 通话纪录
+ * @author  system;
+ * @version    1.0
+ * @date 2018-11-27 03:15:47
  *
  */
 class CallRecordsModel extends BaseModel
@@ -18,7 +21,7 @@ class CallRecordsModel extends BaseModel
      */
     protected $table = 'call_records';
     /**
-    主键
+     * 主键
      */
     protected $primaryKey = 'id';
 
@@ -31,12 +34,16 @@ class CallRecordsModel extends BaseModel
      * @var string
      */
     protected $fillable = [
-                           'phone',
-                           'start_time',
-                           'end_time',
-                           'record_path',
-                           'hangup_dispostion',
-                           'ip'
-                          ];
+        'phone',
+        'start_time',
+        'end_time',
+        'record_path',
+        'hangup_dispostion',
+        'ip',
+        'term_status',
+        'intention',
+        'cdr_id',
+        'call_id'
+    ];
 
 }

+ 33 - 0
database/migrations/2018_11_29_071236_add_term_status_to_call_records.php

xqd
@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddTermStatusToCallRecords extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('call_records', function (Blueprint $table) {
+            $table->integer('term_status')->after('cdr_id')->comment('接通状态');
+            $table->integer('intention')->after('term_status')->comment('客户意向');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('call_records', function (Blueprint $table) {
+            //
+        });
+    }
+}

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

xqd xqd
@@ -28,25 +28,27 @@
                                 </form>
                             </div>
 
-                            @if(role('Call/Records/create'))
-                                <div class="col-sm-8 pull-right">
-                                    <a href="{{ U('Call/Records/create')}}" class="btn btn-primary pull-right">添加</a>
-                                </div>
-                            @endif
+                            {{--@if(role('Call/Records/create'))--}}
+                                {{--<div class="col-sm-8 pull-right">--}}
+                                    {{--<a href="{{ U('Call/Records/create')}}" class="btn btn-primary pull-right">添加</a>--}}
+                                {{--</div>--}}
+                            {{--@endif--}}
                         </div>
                     </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="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="hangup_dispostion"> 挂断原因 </th>
-            <th class="sorting" data-sort="ip"> 拨打IP </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>
@@ -54,28 +56,30 @@
                         @if(isset($list))
                             @foreach($list as $key => $item)
                                 <tr>
-                                    
-            <td>{{ $item->id }}</td>
-            <td>{{ $item->phone }}</td>
-            <td>{{ $item->start_time }}</td>
-            <td>{{ $item->end_time }}</td>
-            <td>{{ $item->record_path }}</td>
-            <td>{{ $item->hangup_dispostion }}</td>
-            <td>{{ $item->ip }}</td>
+
+                                    <td>{{ $item->id }}</td>
+                                    <td>{{ $item->phone }}</td>
+                                    <td>{{ $item->start_time }}</td>
+                                    <td>{{ $item->end_time }}</td>
+                                    <td>{{ $item->record_path }}</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>
+                                        {{--@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
+                                        {{--@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/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])}}'});"