From 2e907c53fe858d6911c48bd354394fa7143c6511 Mon Sep 17 00:00:00 2001 From: lccsw <805383944@qq.com> Date: Tue, 21 Mar 2023 14:40:40 +0800 Subject: [PATCH] add-admin-xz_status_cn --- admin/controllers/receiver/Clues.php | 7 ++++ common/models/receiver/Receiver_xz_model.php | 38 ++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/admin/controllers/receiver/Clues.php b/admin/controllers/receiver/Clues.php index 2c9654c8..4cc0f6b9 100644 --- a/admin/controllers/receiver/Clues.php +++ b/admin/controllers/receiver/Clues.php @@ -214,6 +214,13 @@ class Clues extends HD_Controller if ($row['duration']) { $rec_url = $row['rec_url'] ? build_qiniu_image_url($row['rec_url'], 0, 0, 'video') : ''; $rec_text = '录音文件未生成'; + }else{ + $jsondata = json_decode($row['json_data'],true); + if($row['c_time']>strtotime('2023-03-21 13:00:00')){ + $rec_text = $this->mdReceiverXz->get_xz_status($jsondata['status']); + $answer_text = $this->mdReceiverXz->get_xz_noAnswerReason($jsondata['noAnswerReason']); + $answer_text && $rec_text .= "($answer_text)"; + } } } $setValue['rec_url'] = $rec_url; diff --git a/common/models/receiver/Receiver_xz_model.php b/common/models/receiver/Receiver_xz_model.php index 93229f50..1d70149b 100644 --- a/common/models/receiver/Receiver_xz_model.php +++ b/common/models/receiver/Receiver_xz_model.php @@ -15,4 +15,42 @@ class Receiver_xz_model extends HD_Model { parent::__construct($this->table_name, 'default'); } + + //获取晓致状态 + public function get_xz_status($status=''){ + $arr = [ + -1 => '实时来电通知(是否接听状态未知,非话单记录)', + 0 => '正常接听', + 1 => '未应答', + 2 => '黑名单来电,拒接', + 3 => '虚号关机状态,未接听', + 4 => '未绑定号码', + 5 => '遇忙未接听' + ]; + if(strlen($status)){ + return $arr[$status] ? $arr[$status] : '未知状态'; + }else{ + return $arr; + } + } + + //获取晓致noAnswerReaso对应错误码 + public function get_xz_noAnswerReason($noAnswerReason=''){ + $arr = [ + 11 => '主叫挂机', + 12 => '被叫挂机', + 13 => '被叫正在通话中', + 14 => '被叫无人接听', + 15 => '被叫无法接通', + 16 => '被叫关机', + 17 => '被叫空号', + 18 => '被叫暂停服务', + 19 => '被叫转接失败', + ]; + if(strlen($noAnswerReason)){ + return $arr[$noAnswerReason] ? $arr[$noAnswerReason] : ''; + }else{ + return $arr; + } + } }