From 17f6e032d8a2ef09068d4e5758e63ed901fc50ea Mon Sep 17 00:00:00 2001 From: dengbw Date: Thu, 5 May 2022 14:09:20 +0800 Subject: [PATCH] clues_505 --- admin/controllers/receiver/Clues.php | 51 ++------------ admin/views/biz/store/lists.php | 27 ++++---- admin/views/receiver/clues/edit.php | 99 +--------------------------- 3 files changed, 21 insertions(+), 156 deletions(-) diff --git a/admin/controllers/receiver/Clues.php b/admin/controllers/receiver/Clues.php index 5f5e733f..636dcbab 100644 --- a/admin/controllers/receiver/Clues.php +++ b/admin/controllers/receiver/Clues.php @@ -143,7 +143,7 @@ class Clues extends HD_Controller if (!$id) { return $this->show_json(SYS_CODE_FAIL, '非法参数!'); } - $statusList = $status2List = $logsList = $intention = $autoList = array(); + $statusList = $status2List = $logsList = []; $re = $this->clues_model->get(array('id' => $id)); if (!$re || empty($re)) { return $this->show_json(SYS_CODE_FAIL, '线索不存在!'); @@ -191,30 +191,12 @@ class Clues extends HD_Controller } $info_show['logsList'] = $logsList; //意向信息 - $re_b = $this->mdAutoBrand->get(array('id' => $re['brand_id']), 'name'); - $re_s = $this->mdAutoSeries->get(array('id' => $re['s_id']), 'name'); - $jsondata = $re['jsondata'] ? json_decode($re['jsondata'], true) : array(); - $intention['brand_name'] = '品牌:' . ($re_b ? $re_b['name'] : ''); - $intention['s_name'] = '车系:' . ($re_s ? $re_s['name'] : ''); - $intention['v_name'] = '车型:' . ($jsondata['car']['version']['title'] ? $jsondata['car']['version']['title'] : ''); - $intention['cor_name'] = '车身颜色:' . ($jsondata['car']['color']['title'] ? $jsondata['car']['color']['title'] : ''); - $info_show['intention'] = $intention; - + $jsondata = $re['jsondata'] ? json_decode($re['jsondata'], true) : []; //获取城市区域 $dataInfo['city_id'] = $re['city_id']; $dataInfo['county_id'] = $re['county_id']; - - $autoList[1] = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name'); - if ($re['brand_id']) { - $autoList[2] = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $re['brand_id']), 'id desc', 0, 0, 'id,name'); - } $dataInfo['v_id'] = intval($jsondata['car']['version']['id']); $dataInfo['cor_id'] = intval($jsondata['car']['color']['id']); - if ($re['s_id']) { - $autoList[3] = $this->mdAutoAttr->select(array('type' => 1, 's_id' => $re['s_id']), 'id desc', 0, 0, 'id,title as name'); - $autoList[4] = $this->mdAutoAttr->select(array('type' => 0, 's_id' => $re['s_id']), 'id desc', 0, 0, 'id,title as name'); - } - $info_show['autoList'] = $autoList; //获取已分配店铺 $cus = $this->customers_model->select(['rid' => $re['id']], '', '', '', 'biz_id'); $biz_arr = []; @@ -476,18 +458,9 @@ class Clues extends HD_Controller $this->addLog(array('clue_id' => $info['id'], 'type' => 0, 'log' => $log)); } } else if ($info['editType'] == 3) { - if (!$info['brand_id']) { - return $this->show_json(SYS_CODE_FAIL, '请选择品牌'); - } - $jsondata = $re['jsondata'] ? json_decode($re['jsondata'], true) : array(); - $jsondata['car']['version']['id'] = intval($info['v_id']); - $jsondata['car']['color']['id'] = intval($info['cor_id']); $up_data = [ - 'brand_id' => $info['brand_id'], - 's_id' => $info['s_id'], 'city_id' => $info['city_id'], - 'county_id' => $info['county_id'], - 'jsondata' => json_encode($jsondata, JSON_UNESCAPED_UNICODE) + 'county_id' => $info['county_id'] ]; $ret = $this->clues_model->update($up_data, array('id' => $info['id'])); if (!$ret) { @@ -495,23 +468,7 @@ class Clues extends HD_Controller $msg = '修改意向信息失败'; } else { $msg = '修改意向信息成功'; - if ($info['brand_id']) { - $re_b = $this->mdAutoBrand->get(array('id' => $info['brand_id']), 'name'); - $log = $re_b['name']; - if ($info['s_id']) { - $re_s = $this->mdAutoSeries->get(array('id' => $info['s_id']), 'name'); - $log .= '-' . $re_s['name']; - } - if ($info['v_id']) { - $re_v = $this->mdAutoAttr->get(array('id' => $info['v_id']), 'title'); - $log .= '-' . $re_v['title']; - } - if ($info['cor_id']) { - $re_cor = $this->mdAutoAttr->get(array('id' => $info['cor_id']), 'title'); - $log .= '-' . $re_cor['title']; - } - $this->addLog(array('clue_id' => $info['id'], 'type' => 0, 'log' => '更新意向信息为(' . $log . ')')); - } + $this->addLog(array('clue_id' => $info['id'], 'type' => 0, 'log' => '修改意向信息')); } } return $this->show_json($code, $msg); diff --git a/admin/views/biz/store/lists.php b/admin/views/biz/store/lists.php index 87e1cc50..c96b21dc 100755 --- a/admin/views/biz/store/lists.php +++ b/admin/views/biz/store/lists.php @@ -108,8 +108,8 @@
今天 昨日 - 最近7天 - 最近30天 + 本周 + 本月
@@ -394,23 +394,28 @@ elem: '#id-create-time', range: '~' }); $('.id-day-btn').click(function () { - var type = $(this).data('date'), date = '', d_obj = new Date(); + var type = $(this).data('date'), date = '', nowDate = new Date(); + var beginDate = '', endDate = ''; switch (type) { case 'today': - date = d_obj.Format('yyyy-MM-dd'); - date = date + ' ~ ' + date; + beginDate = endDate = nowDate.Format('yyyy-MM-dd'); break; case 'yesterday': - date = (new Date(d_obj.getTime() - 86400000)).Format('yyyy-MM-dd'); - date = date + ' ~ ' + date; + beginDate = endDate = (new Date(nowDate.getTime() - 86400000)).Format('yyyy-MM-dd'); break; - case '7day': - date = (new Date(d_obj.getTime() - 86400000 * 7)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd'); + case 'weeks': + nowDate.setDate(nowDate.getDate() - nowDate.getDay() + 1); + beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate(); + nowDate.setDate(nowDate.getDate() + 6); + endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate(); break; - case '30day': - date = (new Date(d_obj.getTime() - 86400000 * 30)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd'); + case 'month': + beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-01"; + var day = new Date(nowDate.getFullYear(), nowDate.getMonth() + 1, 0); + endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + day.getDate(); break; } + date = beginDate + ' ~ ' + endDate; $('#id-create-time').val(date); }); }); diff --git a/admin/views/receiver/clues/edit.php b/admin/views/receiver/clues/edit.php index bc2e3cba..9cb2aa16 100644 --- a/admin/views/receiver/clues/edit.php +++ b/admin/views/receiver/clues/edit.php @@ -161,49 +161,6 @@
- - - - - -
-
-
品牌:
- -
-
-
-
车系:
-
-
-
-
车型:
-
-
-
-
车身色:
-
-
@@ -337,7 +294,7 @@ el: '#vue-edit', data: { info: {}, - infoShow: {"intention": {}, 'autoList': []}, + infoShow: {}, goods: {"imgs_url": [], "imgs": [], "log": ''}, cityAry: [], countyAry: [], @@ -393,60 +350,6 @@ } } }, - autoList: function (type) { - var vm = this; - var pid = 0; - if (type == 2) { - if (vm.info.brand_id == 0) { - vm.info.brand_id = 0; - vm.info.s_id = 0; - vm.info.v_id = 0; - vm.info.cor_id = 0; - vm.infoShow['autoList'][2] = []; - vm.infoShow['autoList'][3] = []; - vm.infoShow['autoList'][4] = []; - return; - } - pid = vm.info.brand_id; - } else if (type == 3) { - if (vm.info.s_id == 0) { - vm.info.s_id = 0; - vm.info.v_id = 0; - vm.info.cor_id = 0; - vm.infoShow['autoList'][3] = []; - vm.infoShow['autoList'][4] = []; - return; - } - pid = vm.info.s_id; - } - $.ajax({ - url: '/common/auto', - type: 'get', - dataType: 'json', - data: { - type: type, - pid: pid, - tp: 1, - }, - success: function (data) { - if (data.data) { - if (type == 2) { - vm.info.s_id = 0; - vm.info.v_id = 0; - vm.info.cor_id = 0; - vm.infoShow['autoList'][2] = data.data; - vm.infoShow['autoList'][3] = []; - vm.infoShow['autoList'][4] = []; - } else if (type == 3) { - vm.info.v_id = 0; - vm.info.cor_id = 0; - vm.infoShow['autoList'][3] = data.data[3]; - vm.infoShow['autoList'][4] = data.data[4]; - } - } - }, - }); - }, getStatus2: function () { //二级分类 var vm = this;