From 08b0a3ad4d679c5464e93552dbee67f9200ed340 Mon Sep 17 00:00:00 2001 From: lcc <1127794702@qq.com> Date: Tue, 11 Jun 2024 16:23:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=95=86=E5=93=81=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=92=8C=E5=90=8E=E5=8F=B0=E7=94=B5=E8=AF=9D=E7=BB=91?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/config/ycall.php | 2 +- admin/controllers/receiver/Clues.php | 9 +- admin/controllers/receiver/Items.php | 138 +++++++++++++++++++++++++++ admin/views/receiver/items/edit.php | 120 +++++++++++++++++++++++ admin/views/receiver/items/lists.php | 91 ++++++++++++++++++ api/controllers/plan/Yxcall.php | 8 +- api/controllers/wxapp/licheb/Yx.php | 1 + common/models/item/Item_model.php | 7 ++ 8 files changed, 363 insertions(+), 13 deletions(-) create mode 100644 admin/controllers/receiver/Items.php create mode 100644 admin/views/receiver/items/edit.php create mode 100644 admin/views/receiver/items/lists.php diff --git a/admin/config/ycall.php b/admin/config/ycall.php index d42f3759..47c3effc 100644 --- a/admin/config/ycall.php +++ b/admin/config/ycall.php @@ -1,5 +1,5 @@ load->model('receiver/receiver_clues_cfrom_model', 'clues_cfrom_model'); $this->load->model('receiver/receiver_customers_model', 'customers_model'); $this->load->model('receiver/receiver_clue_oplogs_model', 'mdOplogs'); -// $this->load->model('receiver/receiver_xz_model', 'mdReceiverXz'); + $this->load->model('receiver/receiver_yx_model', 'mdReceiverXz'); // $this->load->model('app/licheb/app_licheb_users_model'); $this->load->model("biz/biz_model"); // $this->load->model('auto/auto_brand_model', 'mdAutoBrand'); @@ -258,13 +258,6 @@ 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/admin/controllers/receiver/Items.php b/admin/controllers/receiver/Items.php new file mode 100644 index 00000000..7571139e --- /dev/null +++ b/admin/controllers/receiver/Items.php @@ -0,0 +1,138 @@ +load->model('item/item_model'); + $this->load->model("area_model"); + } + + public function index() + { + return $this->lists(); + } + + public function lists() + { + $params = $this->input->get(); + $params['page'] = $params['page'] ? intval($params['page']) : 1; + $params['size'] = $params['size'] ? intval($params['size']) : 20; + !strlen($params['status']) && $params['status'] = ''; + $lists = array(); + $where = []; + strlen($params['status']) && $where['status'] = intval($params['status']); + $count = $this->item_model->count($where); + $status_array = $this->item_model->status_array(); + if ($count) { + $res = $this->item_model->select($where, "id desc", $params['page'], $params['size']); + $province_ids = implode(',', array_unique(array_column($res, 'province_id'))); + $area_rows = []; + if ($province_ids) { + $area_where = [ + "province_id in ($province_ids)" => null + ]; + $area_rows = $this->area_model->map('province_id', '', $area_where, '', 0, 0, 'distinct(province_id), province_name'); + } + foreach ($res as $key => $value) { + $value['status_name'] = $status_array[$value['status']]; + $value['province_name'] = $value['province_id'] > 0 ? $area_rows[$value['province_id']][0]['province_name'] : '所有省份'; + $lists[] = $value; + } + } + $this->data['lists'] = $lists; + $this->data['params'] = $params; + unset($status_array['-1']); + $this->data['status_array'] = $status_array; + $this->data['_title'] = '商品列表'; + $this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count); + return $this->show_view('/receiver/items/lists', true); + } + + public function get() + { + $id = intval($this->input->get('id')); + $info = ['province_id' => 0]; + if ($id) { + $info = $this->item_model->get(['id' => $id]); + $info['src_img'] = build_qiniu_image_url($info['img']); + } + $this->data['provinces'] = $this->province_ary(); + $this->data['info'] = $info; + $this->data['_title'] = $id ? '编辑' : '新增'; + return $this->show_view('/receiver/items/edit', true); + } + + public function add() + { + $info = $this->input->post(); + $data = [ + 'title' => $info['title'], + 's_time' => $info['s_time'], + 'e_time' => $info['e_time'], + 'img' => $info['img'], + 'province_id' => $info['province_id'], + 'descrip' => $info['descrip'], + ]; + $res = $this->item_model->add($data); + if (!$res) { + return $this->show_json(SYS_CODE_FAIL, '保存失败'); + } + return $this->show_json(SYS_CODE_SUCCESS, '保存成功'); + } + + //编辑单条数据 + public function edit() + { + $info = $this->input->post(); + $row = $this->item_model->get(['id' => $info['id']]); + if (!$row) return $this->show_json(SYS_CODE_FAIL, '数据不存在'); + $up_data = [ + 'title' => $info['title'], + 's_time' => $info['s_time'], + 'e_time' => $info['e_time'], + 'img' => $info['img'], + 'province_id' => $info['province_id'], + 'descrip' => $info['descrip'], + ]; + $res = $this->item_model->update($up_data, ['id' => $info['id']]); + if (!$res) { + return $this->show_json(SYS_CODE_FAIL, '保存失败'); + } + return $this->show_json(SYS_CODE_SUCCESS, '保存成功'); + } + + public function del() + { + + } + + public function batch() + { + + } + + public function export() + { + + } + + public function edit_status() + { + $id = $this->input->post('id'); + $row = $this->item_model->get(['id' => $id]); + if (!$row) return $this->show_json(SYS_CODE_FAIL, '数据不存在'); + $status = $row['status'] ? 0 : 1; + $up_data = [ + 'status' => $status + ]; + $res = $this->item_model->update($up_data, ['id' => $id]); + if (!$res) { + return $this->show_json(SYS_CODE_FAIL, '保存失败'); + } + return $this->show_json(SYS_CODE_SUCCESS, '保存成功'); + } +} \ No newline at end of file diff --git a/admin/views/receiver/items/edit.php b/admin/views/receiver/items/edit.php new file mode 100644 index 00000000..2f017fef --- /dev/null +++ b/admin/views/receiver/items/edit.php @@ -0,0 +1,120 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+ + + +
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+ + \ No newline at end of file diff --git a/admin/views/receiver/items/lists.php b/admin/views/receiver/items/lists.php new file mode 100644 index 00000000..cce46384 --- /dev/null +++ b/admin/views/receiver/items/lists.php @@ -0,0 +1,91 @@ +
+ +
+
共有条数据
+ + + + + + + + + + + + + + + +
id标题适用省份开始时间结束时间状态操作
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/api/controllers/plan/Yxcall.php b/api/controllers/plan/Yxcall.php index ec38c4c9..704819cf 100644 --- a/api/controllers/plan/Yxcall.php +++ b/api/controllers/plan/Yxcall.php @@ -20,8 +20,8 @@ class Yxcall extends HD_Controller $str = file_get_contents('php://input'); debug_log('string:' . $str, $this->log_file); $data = json_decode($str, true); - if ($data && $data['customerData']) { - $row = $this->receiver_yx_model->get(array('call_id' => $data['customerData'])); + if ($data && $data['bindId']) { + $row = $this->receiver_yx_model->get(array('bind_id' => $data['bindId'])); if ($row) { $jsondata = json_decode($row['json_data'], true); $data['uname'] = $jsondata['uname']; @@ -58,9 +58,9 @@ class Yxcall extends HD_Controller $addData['customer_id'] = $row['cf_id']; } $this->mdOplogs->add($addData); - $xcall = new Xcall($this->admin_config); + $ycall = new Ycall(); //解绑 - $xcall->SWunbind($data['to'], $data['virtualMobile']); + $ycall->AXBUnbind($data['virtualMobile'], $data['calleeNumber']); } elseif ($row['cf_id'] && $row['cf_platform'] == 'api') { //理车宝 $ycall = new Ycall(); //解绑 diff --git a/api/controllers/wxapp/licheb/Yx.php b/api/controllers/wxapp/licheb/Yx.php index 5135fab7..8e16798c 100644 --- a/api/controllers/wxapp/licheb/Yx.php +++ b/api/controllers/wxapp/licheb/Yx.php @@ -51,6 +51,7 @@ class Yx extends Wxapp } else { $call_mobile = $result['middleNumber']; $add_data = [ + 'bind_id' => $result['bindId'], 'call_id' => $seq_id, 'display_number' => $call_mobile, 'biz_id' => $row['biz_id'], diff --git a/common/models/item/Item_model.php b/common/models/item/Item_model.php index 2d1afb2b..0994f40e 100644 --- a/common/models/item/Item_model.php +++ b/common/models/item/Item_model.php @@ -5,8 +5,15 @@ class Item_model extends HD_Model { private $table_name = 'lc_items'; + private $status_arr = [ '-1' => '删除',0 => '下架',1 => '正常']; + public function __construct() { parent::__construct($this->table_name, 'default'); } + + public function status_array() + { + return $this->status_arr; + } }