From 6418ceac081646ee6f3c529e2b2fed7de761b399 Mon Sep 17 00:00:00 2001 From: lccsw <1127794702@qq.com> Date: Wed, 25 Aug 2021 17:44:01 +0800 Subject: [PATCH] edit-liche-clues_cfrom --- admin/controllers/Common.php | 39 +++++++++++++++++++++++ admin/controllers/app/liche/Cms.php | 13 +++++--- admin/views/app/liche/cms/edit.php | 28 ++++++++++------ api/controllers/wxapp/liche/Aptinfo.php | 17 ++++++---- api/controllers/wxapp/licheb/Cusorder.php | 2 +- 5 files changed, 77 insertions(+), 22 deletions(-) diff --git a/admin/controllers/Common.php b/admin/controllers/Common.php index ef01653d..daaf0a9e 100644 --- a/admin/controllers/Common.php +++ b/admin/controllers/Common.php @@ -1356,6 +1356,45 @@ class Common extends CI_Controller $this->data['itemsPage'] = array('page' => $page, 'pageLimit' => $size, 'pageCount' => $count, 'hasNext' => $hasNext); return $this->show_json(SYS_CODE_SUCCESS); } + /** + * Notes:选择品牌 + */ + public function brands() + { + $this->load->model('auto/auto_brand_model'); + $this->load->model('auto/auto_series_model'); + $page = $this->input->post('page') ? intval($this->input->post('page')) : 1; + $size = $this->input->post('size') ? intval($this->input->post('size')) : 10; + + $use_items_list = $this->input->post('use_items_list'); + $title = $this->input->post('title'); + $status = intval($this->input->post('status')); + $itemsChecked = $itemsList = $resItems = array(); + if ($use_items_list) { + foreach ($use_items_list as $key => $value) { + $itemsChecked[$value['id']] = $value['id']; + } + } + $where = []; + $status && $where['status'] = $status; + $title && $where['name like "%' . $title . '%"'] = null; + $count = $this->auto_brand_model->count($where); + $itemsList = []; + if ($count) { + $lists = $this->auto_brand_model->select($where, 'id desc', $page, $size); + foreach ($lists as $key => $val) { + $itemsList[] = [ + 'id' => $val['id'], + 'name' => $val['name'], + 'is_checked' => $itemsChecked[$val['id']] ? 1 : 0 + ]; + } + } + $this->data['itemsList'] = $itemsList; + $hasNext = ceil($count / $size) > $page ? 1 : 0; + $this->data['itemsPage'] = array('page' => $page, 'pageLimit' => $size, 'pageCount' => $count, 'hasNext' => $hasNext); + return $this->show_json(SYS_CODE_SUCCESS); + } /** * Notes:车型库 diff --git a/admin/controllers/app/liche/Cms.php b/admin/controllers/app/liche/Cms.php index 69066833..d744ca41 100755 --- a/admin/controllers/app/liche/Cms.php +++ b/admin/controllers/app/liche/Cms.php @@ -17,6 +17,7 @@ class Cms extends HD_Controller parent::__construct(); $this->load->model('app/liche/App_liche_cms_model', 'liche_cms_model'); $this->load->model('app/App_model', 'appM'); + $this->load->model('receiver/receiver_clues_cfrom_model', 'clues_cfrom_model'); $this->pos_arr = $this->liche_cms_model->get_position(true); } @@ -70,6 +71,7 @@ class Cms extends HD_Controller $row['btn_type'] = $json['btn_type'] ? $json['btn_type'] : 1; $row['bg_img'] = $json['bg_img'] ? $json['bg_img'] : ''; $row['bg_img_src'] = $json['bg_img'] ? build_qiniu_image_url($json['bg_img']) : ''; + $row['cfrom_id'] = $json['cfrom_id'] ? $json['cfrom_id']:0; $row['link'] = $row['url']; $row['s_time'] = date('Y-m-d H:i:s', $row['s_time']); $row['e_time'] = date('Y-m-d H:i:s', $row['e_time']); @@ -77,12 +79,13 @@ class Cms extends HD_Controller $title = "编辑{$row['title']}"; } else { - $row = array('position' => '', 'type' => 1,'btn_type'=>1); + $row = array('position' => '', 'type' => 1,'btn_type'=>1,'cfrom_id' => 0); $opration = 'add'; $title = '添加推送信息'; $covers = array(); } //列表 + $this->data['cfroms'] = $this->clues_cfrom_model->select(['status'=>1],'id desc','','','id,title'); $this->data['app_id'] = 3; $this->data['info'] = $row; $this->data['pos_arr'] = $this->pos_arr; @@ -121,6 +124,7 @@ class Cms extends HD_Controller ]; $json = array(); + $input['cfrom_id'] && $json['cfrom_id'] = $input['cfrom_id']; $input['btn_type'] && $json['btn_type'] = $input['btn_type']; $input['bg_img'] && $json['bg_img'] = $input['bg_img']; if($json){ @@ -153,6 +157,7 @@ class Cms extends HD_Controller $input['link'] = $input['link'] . trim($input['param']); $input['btn_type'] && $json['btn_type'] = $input['btn_type']; $input['bg_img'] && $json['bg_img'] = $input['bg_img']; + $input['cfrom_id'] && $json['cfrom_id'] = $input['cfrom_id']; $upd = [ 'title' => $input['title'] ? $input['title'] : '', 'url' => $input['link'] ? $input['link'] : '', @@ -197,12 +202,10 @@ class Cms extends HD_Controller public function get_car(){ $this->load->model('auto/auto_brand_model'); - $this->load->model('auto/auto_series_model'); $id = $this->input->post('id'); - $row = $this->auto_series_model->get(['id'=>$id]); - $b_row = $this->auto_brand_model->get(['id'=>$row['brand_id']]); + $row = $this->auto_brand_model->get(['id'=>$id]); $info['id'] = $row['id']; - $info['title'] = $b_row['name'].$row['name']; + $info['title'] = $row['name']; $info['img'] = '/img/visits/add.jpg'; $this->data['data'] = $info; return $this->show_json(SYS_CODE_SUCCESS); diff --git a/admin/views/app/liche/cms/edit.php b/admin/views/app/liche/cms/edit.php index e2e0269a..2b680fe3 100755 --- a/admin/views/app/liche/cms/edit.php +++ b/admin/views/app/liche/cms/edit.php @@ -34,7 +34,7 @@
-
+