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 | +标题 | +适用省份 | +开始时间 | +结束时间 | +状态 | +操作 | +
|---|---|---|---|---|---|---|
| {{value.id}} | +{{value.title}} | +{{value.province_name}} | +{{value.s_time}} | +{{value.e_time}} | +{{value.status_name}} | ++ + + | +