wesley преди 7 години
родител
ревизия
daa696e643

+ 6 - 1
app/Models/CallRecordsModel.php

xqd
@@ -43,9 +43,14 @@ class CallRecordsModel extends BaseModel
         'term_status',
         'intention',
         'cdr_id',
-        'call_id'
+        'call_id',
+        'tag'
     ];
 
+    /***
+     * 通话详情
+     * @return mixed
+     */
     public function process()
     {
         return CallRecordsProcessModel::where('call_id', $this->call_id)->where('ip', $this->ip)->get();

+ 2 - 1
app/Repositories/Call/RecordsRepository.php

xqd
@@ -48,7 +48,8 @@ class RecordsRepository extends Repository
         if (isset($search['phone']) && !empty($search['phone'])) {
             $keywords = '%' . $search['phone'] . '%';
             $currentQuery = $currentQuery->where(function ($query) use ($keywords) {
-                $query->where('phone', 'like', $keywords);
+                $query->where('phone', 'like', $keywords)
+                ->orWhere('tag','like',$keywords) ;
             });
         };
 

+ 2 - 2
pyshell/psql_sync_mysql.py

xqd
@@ -60,11 +60,11 @@ if __name__ == '__main__':
                          ([call_record[9]]))
         task_name = postgres_cur.fetchone()
         tk_id = call_record[9]
-        task_name = task_name['tk_name'] if task_name else '任务' + str(tk_id)
+        task_name = task_name[0] if task_name else '任务' + str(tk_id)
 
         record_path = ip+':8088/recordings/'+call_record[3]
         mysql_cur.execute(
-            """insert into  call_records(phone, start_time, end_time, record_path, hangup_dispostion, call_id, cdr_id, term_status,intention, ip,tag) value (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)""",
+            """insert into  call_records(phone, start_time, end_time, record_path, hangup_dispostion, call_id, cdr_id, term_status,intention, ip,tag) value (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)""",
             (call_record[0], call_record[1], call_record[2], record_path,
              call_record[4], call_record[5], call_record[6], call_record[7], call_record[8], ip,task_name)
         )

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

xqd xqd
@@ -12,6 +12,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 class="sorting" data-sort="tag"> 标签</th>
         <th width="22%">相关操作</th>
     </tr>
     </thead>
@@ -31,6 +32,7 @@
                 <td>{{ $item->term_status }}</td>
                 <td>{{ $item->hangup_dispostion }}</td>
                 <td>{{ $item->ip }}</td>
+                <td>{{ $item->tag }}</td>
                 <td>
 
                     @if(role('Call/Records/view'))

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

xqd
@@ -54,7 +54,7 @@
                             <th>
                                 <div class="input-group">
                                     <input type="text" class="form-control" value="{{Request::get('phone')}}"
-                                           placeholder="请输入电话号码"
+                                           placeholder="请输入电话号码或标签"
                                            name="phone">
                                     <span class="input-group-append">
                                                 <span class="btn btn-sm btn-default"