From 8e083c38d080773f92013aa89661093bc29078b6 Mon Sep 17 00:00:00 2001 From: dengbw Date: Mon, 18 Jul 2022 15:19:21 +0800 Subject: [PATCH] customers_718 --- admin/controllers/app/licheb/Userslog.php | 25 ++++-- admin/controllers/items/goods/Goods.php | 14 ++-- admin/views/app/licheb/userslog/lists.php | 9 ++- admin/views/items/goods/edit.php | 95 ++++++++++++----------- 4 files changed, 81 insertions(+), 62 deletions(-) diff --git a/admin/controllers/app/licheb/Userslog.php b/admin/controllers/app/licheb/Userslog.php index 9508cf1e..0e4b0174 100644 --- a/admin/controllers/app/licheb/Userslog.php +++ b/admin/controllers/app/licheb/Userslog.php @@ -88,12 +88,12 @@ class Userslog extends HD_Controller $time[1] && $where["log_date<="] = $time[1]; } $total = $this->mdBizsLog->count($where); + $offlineSources = $this->mdCustomers->offlineSources(); if ($total) { $res = $this->mdBizsLog->select($where, "id desc", $params['page'], $params['size']); if ($res) { $str_ids = implode(',', array_unique(array_column($res, 'biz_id'))); $map_biz = $this->mdBiz->map('id', 'biz_name', ["id in ({$str_ids})" => null]); - $offlineSources = $this->mdCustomers->offlineSources(); foreach ($res as $v) { $biz_name = $biz_type = $customer_info = $c_num_info = $order_info = ''; $customers = $c_num = $orders = 0; @@ -160,12 +160,23 @@ class Userslog extends HD_Controller } } if ($params['size'] != 10000) { - $sum = $this->mdUsersLog->sum('customers', $where); - $menus[] = ['title' => "客户数", 'value' => intval($sum['customers']), 'tag' => '人']; - $sum_c = $this->mdUsersLog->sum('c_num', $where); - $menus[] = ['title' => "进店人数", 'value' => intval($sum_c['c_num']), 'tag' => '人']; - $sum = $this->mdUsersLog->sum('orders', $where); - $menus[] = ['title' => "订单数", 'value' => intval($sum['orders']), 'tag' => '个']; + $sum = $this->mdUsersLog->sum('customers', $where);//客户数 + $customers = "总数:{$sum['customers']}"; + $sum = $this->mdUsersLog->sum('c_num', $where);//进店人数 + $c_num = "总数:{$sum['c_num']}"; + $sum = $this->mdUsersLog->sum('orders', $where);//订单数 + $orders = "总数:{$sum['orders']}"; + foreach ($offlineSources as $k => $v) { + $sum2 = $this->mdUsersLog->sum("customer_{$k}", $where);//客户数 + $sum2['customer_' . $k] && $customers .= "
{$v['name']}:{$sum2['customer_'.$k]}"; + $sum2 = $this->mdUsersLog->sum("c_num_{$k}", $where);//进店人数 + $sum2['c_num_' . $k] && $c_num .= "
{$v['name']}:{$sum2['c_num_'.$k]}"; + $sum2 = $this->mdUsersLog->sum("order_{$k}", $where);//订单数 + $sum2['order_' . $k] && $orders .= "
{$v['name']}:{$sum2['order_'.$k]}"; + } + $menus[] = ['title' => "客户数", 'note' => $customers]; + $menus[] = ['title' => "进店人数", 'note' => $c_num]; + $menus[] = ['title' => "订单数", 'note' => $orders]; $sum = $this->mdUsersLog->sum('t_num', $where); $menus[] = ['title' => "试驾数", 'value' => intval($sum['t_num']), 'tag' => '次']; $sum = $this->mdUsersLog->sum('defeats', $where); diff --git a/admin/controllers/items/goods/Goods.php b/admin/controllers/items/goods/Goods.php index ceb70158..89e76921 100644 --- a/admin/controllers/items/goods/Goods.php +++ b/admin/controllers/items/goods/Goods.php @@ -65,7 +65,7 @@ class Goods extends HD_Controller $where_1['s_id'] = $params['s_id']; $where_2['m.s_id'] = $params['s_id']; $where_3['m.s_id'] = $params['s_id']; - $autoList[3] = $this->mdAutoAttr->select(array('status' => 1,'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name'); + $autoList[3] = $this->mdAutoAttr->select(array('status' => 1, 'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name'); } if ($params['v_id']) { $where['v_id'] = $params['v_id']; @@ -413,9 +413,9 @@ class Goods extends HD_Controller $autoList[2] = $this->mdAutoSeries->select(array('status>' => -1, 'brand_id' => $re['brand_id']), 'id desc', 0, 0, 'id,name'); } if ($re['s_id']) { - $autoList[3] = $this->mdAutoAttr->select(array('status>' => -1,'type' => 1, 's_id' => $re['s_id']), 'id desc', 0, 0, 'id,title as name'); - $autoList[4] = $this->mdAutoAttr->select(array('status>' => -1,'type' => 0, 's_id' => $re['s_id']), 'id desc', 0, 0, 'id,title as name'); - $autoList[5] = $this->mdAutoAttr->select(array('status>' => -1,'type' => 2, 's_id' => $re['s_id']), 'id desc', 0, 0, 'id,title as name'); + $autoList[3] = $this->mdAutoAttr->select(array('status>' => -1, 'type' => 1, 's_id' => $re['s_id']), 'id desc', 0, 0, 'id,title as name'); + $autoList[4] = $this->mdAutoAttr->select(array('status>' => -1, 'type' => 0, 's_id' => $re['s_id']), 'id desc', 0, 0, 'id,title as name'); + $autoList[5] = $this->mdAutoAttr->select(array('status>' => -1, 'type' => 2, 's_id' => $re['s_id']), 'id desc', 0, 0, 'id,title as name'); } $info['city_id'] = ''; $info['county_id'] = ''; @@ -439,13 +439,15 @@ class Goods extends HD_Controller $_title = '编辑商品'; $edit_url = '/items/goods/goods/edit'; + $where_auto = ['status>' => -1]; } else { $info['fine_ids'] = array(); $info['in_time'] = date('Y-m-d H:i:s'); $_title = '新增商品'; $edit_url = '/items/goods/goods/add'; + $where_auto = ['status' => 1]; } - $autoList[1] = $this->mdAutoBrand->select(array('status>' => -1), 'id desc', 0, 0, 'id,name'); + $autoList[1] = $this->mdAutoBrand->select($where_auto, 'id desc', 0, 0, 'id,name'); $showInfo['autoList'] = $autoList; $showInfo['comList'] = $comList; $showInfo['statusAry'] = $this->statusAry; @@ -863,7 +865,7 @@ class Goods extends HD_Controller $where_1['s_id'] = $params['s_id']; $where_2['m.s_id'] = $params['s_id']; $where_3['m.s_id'] = $params['s_id']; - $autoList[3] = $this->mdAutoAttr->select(array('status' => 1,'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name'); + $autoList[3] = $this->mdAutoAttr->select(array('status' => 1, 'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name'); } if ($params['v_id']) { $where['v_id'] = $params['v_id']; diff --git a/admin/views/app/licheb/userslog/lists.php b/admin/views/app/licheb/userslog/lists.php index 35641a81..86982827 100644 --- a/admin/views/app/licheb/userslog/lists.php +++ b/admin/views/app/licheb/userslog/lists.php @@ -2,7 +2,12 @@ $value) { ?> -
+
+ + + + + @@ -231,7 +236,7 @@ var that = this; if (nv == '') { that.bizAry = []; - that.params.biz_id = ''; + that.params.biz_id = ''; } else { $.ajax({ type: 'post', diff --git a/admin/views/items/goods/edit.php b/admin/views/items/goods/edit.php index 85e09b1a..7fca909a 100644 --- a/admin/views/items/goods/edit.php +++ b/admin/views/items/goods/edit.php @@ -151,15 +151,15 @@ - - - - - - - - - + + + + + + + + + @@ -198,44 +198,44 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +