From 17045c2e9cdb005cf3f124ccd4b3683acd652b35 Mon Sep 17 00:00:00 2001 From: dengbw Date: Tue, 16 Aug 2022 16:52:42 +0800 Subject: [PATCH] order_816_2 --- admin/controllers/stats/Order.php | 16 ++++++++-------- api/controllers/wxapp/licheb/Biz.php | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/admin/controllers/stats/Order.php b/admin/controllers/stats/Order.php index a8314bf4..48a113b4 100644 --- a/admin/controllers/stats/Order.php +++ b/admin/controllers/stats/Order.php @@ -158,6 +158,13 @@ class order extends HD_Controller } //进店数 if ($params['type'] == 2) { + $num_into = $this->mdUsersLog->db->select('a.id') + ->from('lc_receiver_customer_oplogs as a') + ->join('lc_receiver_customers as b', "b.id=a.customer_id", 'left') + ->where(['a.type' => 4, 'a.log' => '客户到店', 'a.c_time>=' => $c_time['s_time'], 'a.c_time<=' => $c_time['e_time'], + 'b.status>=' => 0, 'b.biz_id' => $k, 'b.of_id' => $k2]) + ->count_all_results(); + } else { if ($params['num_into']) { $num_into = $params['num_into']; } else { @@ -165,16 +172,9 @@ class order extends HD_Controller ->from('lc_receiver_customer_oplogs as a') ->join('lc_receiver_customers as b', "b.id=a.customer_id", 'left') ->where(['a.type' => 4, 'a.log' => '客户到店', 'a.c_time>=' => $c_time['s_time'], 'a.c_time<=' => $c_time['e_time'], - 'b.status>=' => 0, 'b.biz_id' => $k, 'b.of_id' => $k2]) + 'b.status>=' => 0, 'b.biz_id' => $k, 'b.of_id' => $k2, 'b.c_time>=' => $c_time['s_time'], 'b.c_time<=' => $c_time['e_time']]) ->count_all_results(); } - } else { - $num_into = $this->mdUsersLog->db->select('a.id') - ->from('lc_receiver_customer_oplogs as a') - ->join('lc_receiver_customers as b', "b.id=a.customer_id", 'left') - ->where(['a.type' => 4, 'a.log' => '客户到店', 'a.c_time>=' => $c_time['s_time'], 'a.c_time<=' => $c_time['e_time'], - 'b.status>=' => 0, 'b.biz_id' => $k, 'b.of_id' => $k2, 'b.c_time>=' => $c_time['s_time'], 'b.c_time<=' => $c_time['e_time']]) - ->count_all_results(); } $into_sum[$k3] += $num_into; $stats_into[] = $num_into; diff --git a/api/controllers/wxapp/licheb/Biz.php b/api/controllers/wxapp/licheb/Biz.php index c266628e..fce043ca 100644 --- a/api/controllers/wxapp/licheb/Biz.php +++ b/api/controllers/wxapp/licheb/Biz.php @@ -74,7 +74,7 @@ class Biz extends Wxapp $data['funnel'] = ['title' => '线索转化漏斗', 'expected_data' => [['name' => "成交数({$orders_per}%)", 'value' => 33.3], ['name' => "到店数({$intos_per}%)", 'value' => 66.7], ['name' => '客户数100%', 'value' => 100]] , 'actual_data' => [['name' => '成交数', 'value' => $orders], ['name' => '到店数', 'value' => $intos], ['name' => '客户量', 'value' => $customers]]]; - $data['title'] = '门店数据'; + $data['title'] = '数据看板'; return $data; }