From 49d3e59b594de7b4e0d93a657da600fbf3369717 Mon Sep 17 00:00:00 2001 From: dengbw Date: Thu, 13 Oct 2022 11:24:03 +0800 Subject: [PATCH] user_10113 --- admin/controllers/app/material/Template.php | 23 +++++++++++++- admin/views/app/material/template/lists.php | 34 ++++++++++++++++++--- api/controllers/wxapp/licheb/User.php | 11 +++++-- 3 files changed, 59 insertions(+), 9 deletions(-) diff --git a/admin/controllers/app/material/Template.php b/admin/controllers/app/material/Template.php index 3bb8d5e6..bdc14c3a 100644 --- a/admin/controllers/app/material/Template.php +++ b/admin/controllers/app/material/Template.php @@ -52,6 +52,7 @@ class Template extends HD_Controller $setValue['title'] = $value['title']; $setValue['type_name'] = $this->mdTemplate->typeAry()[$value['type']]; $setValue['status_name'] = $this->mdTemplate->statusAry()[$value['status']]; + $setValue['status'] = $value['status']; $brands = ''; if ($value['brand_ids']) { $res_b = $this->mdAutoBrand->select(array("id in ({$value['brand_ids']})" => null, 'status' => 1), "id desc", 0, 0, 'name'); @@ -391,7 +392,27 @@ class Template extends HD_Controller //批量操作(默认修改状态) public function batch() { - + $field = $this->input->post('field'); + if ($field === 'ifcheck') { + $status = intval($this->input->post('value')); + $ids = $this->input->post('id'); + $ids = explode(',', $ids); + if (!$ids || count($ids) < 1) { + $this->show_json(0, '请选择要操作的选项'); + } + $ids_str = implode(',', $ids); + $where = ["id in({$ids_str})" => null]; + } else { + $id = intval($this->input->post('id')); + $status = intval($this->input->post('value')); + if (!$id) { + $this->show_json(0, '参数错误'); + } + $where['id'] = $id; + } + $data['status'] = $status; + $this->mdTemplate->update($data, $where); + return $this->show_json(SYS_CODE_SUCCESS, '保存成功'); } //导出数据列表 diff --git a/admin/views/app/material/template/lists.php b/admin/views/app/material/template/lists.php index 7260c17f..bb4db383 100644 --- a/admin/views/app/material/template/lists.php +++ b/admin/views/app/material/template/lists.php @@ -48,17 +48,21 @@ - - - - + + + + + - + + @@ -79,6 +83,13 @@ data-title="分享连接">分享链接查看详情 + + @@ -87,6 +98,19 @@
id模板名称模板分类适用品牌id模板名称模板分类适用品牌 状态创建时间创建时间
+ +
+
+ +
+ +
+
diff --git a/api/controllers/wxapp/licheb/User.php b/api/controllers/wxapp/licheb/User.php index 159aa8a4..09b6905d 100644 --- a/api/controllers/wxapp/licheb/User.php +++ b/api/controllers/wxapp/licheb/User.php @@ -341,6 +341,9 @@ class User extends Wxapp //战败 $where_today_defeat = ['type' => 7, 'c_time>=' => strtotime($s_today), 'c_time<=' => strtotime($e_today)]; $where_month_defeat = ['type' => 7, 'c_time>=' => strtotime($s_month), 'c_time<=' => strtotime($e_month)]; + //退订 + $where_today_refund = ['biz_id' => $biz_id, 'status' => 2, 'refund_time>=' => $s_today, 'refund_time<=' => $e_today]; + $where_month_refund = ['biz_id' => $biz_id, 'status' => 2, 'refund_time>=' => $s_month, 'refund_time<=' => $e_month]; $where_customer_id = "customer_id in(select id from lc_receiver_customers where biz_id={$biz_id} and cs_biz_id!=-1)"; if ($group_id == 1) { $where_today_xs['admin_id'] = $uid; @@ -351,6 +354,8 @@ class User extends Wxapp $where_month_order['sale_id'] = $uid; $where_today_defeat['uid'] = $uid; $where_month_defeat['uid'] = $uid; + $where_today_refund['sale_id'] = $uid; + $where_month_refund['sale_id'] = $uid; $where_customer_id = "customer_id in(select id from lc_receiver_customers where admin_id={$uid} and biz_id={$biz_id} and cs_biz_id!=-1)"; if ($this->session['userid']) { $where_today_qy['userid'] = $this->session['userid']; @@ -383,8 +388,6 @@ class User extends Wxapp } $where_today_dd[$where_customer_id] = null; $where_month_dd[$where_customer_id] = null; - $where_today_order[$where_customer_id] = null; - $where_month_order[$where_customer_id] = null; $where_today_defeat[$where_customer_id] = null; $where_month_defeat[$where_customer_id] = null; $statistics = [ @@ -396,7 +399,9 @@ class User extends Wxapp ['today' => ['title' => '今日', 'value' => $this->receiver_orders_v2_model->count($where_today_order)] , 'month' => ['title' => '本月订单', 'value' => $this->receiver_orders_v2_model->count($where_month_order)]], ['today' => ['title' => '今日', 'value' => $this->mdCustomerOpLogs->count($where_today_defeat)] - , 'month' => ['title' => '本月战败', 'value' => $this->mdCustomerOpLogs->count($where_month_defeat)]] + , 'month' => ['title' => '本月战败', 'value' => $this->mdCustomerOpLogs->count($where_month_defeat)]], + ['today' => ['title' => '今日', 'value' => $this->receiver_orders_v2_model->count($where_today_refund)] + , 'month' => ['title' => '本月退订', 'value' => $this->receiver_orders_v2_model->count($where_month_refund)]] ]; $data = [ 'wl_count' => ['title' => '待跟进客户(人)', 'num' => $wl_num, 'url' => '/pages/customer/filterList/index?status=1&visit=1&title=待跟进客户'],