From 2eb00cc2e9fdc11da0edee089ca610fce217ff33 Mon Sep 17 00:00:00 2001 From: dengbw Date: Mon, 15 Aug 2022 15:25:55 +0800 Subject: [PATCH] persona_815_3 --- api/controllers/wxapp/licheb/Biz.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/api/controllers/wxapp/licheb/Biz.php b/api/controllers/wxapp/licheb/Biz.php index 507c8a41..36675f76 100644 --- a/api/controllers/wxapp/licheb/Biz.php +++ b/api/controllers/wxapp/licheb/Biz.php @@ -55,7 +55,8 @@ class Biz extends Wxapp $res_user = $this->app_user_model->select(['status' => 1, 'userid<>' => '', 'biz_id' => $this->biz_id], 'id desc', 0, 0, 'userid'); if ($res_user) { $str_ids = implode("','", array_unique(array_column($res_user, 'userid'))); - $wxqys_add = $this->mdWechatqyLog->count(["userid in('{$str_ids}')" => null, 'change_type' => 'add_external_contact']); + $wxqys_add = $this->mdWechatqyLog->count(["userid in('{$str_ids}')" => null, 'change_type' => 'add_external_contact' + , 'c_time>=' => $c_time['s_time'], 'c_time<=' => $c_time['e_time']]); } //点亮 $wxqys = $this->mdCustomers->count(['biz_id' => $this->biz_id, 'status>=' => 0, 'c_time>=' => $c_time['s_time'], @@ -96,9 +97,10 @@ class Biz extends Wxapp $customers[] = $this->mdCustomers->count(['biz_id' => $this->biz_id, 'status>=' => 0, 'c_time>=' => $c_time['s_time'], 'c_time<=' => $c_time['e_time']]);; $orders[] = $this->mdOrders->count(['biz_id' => $this->biz_id, 'status>=' => 0, 'order_time>=' => $o_time['s_time'], 'order_time<=' => $o_time['e_time']]); } - $data = ['title' => "近{$days}日走势图", 'legend_data' => ["近{$days}日客户数", "近{$days}日订单数"], 'xAxis' => $xAxis, - 'series' => [['name' => "近{$days}日客户数", 'type' => 'line', 'stack' => '总量', 'smooth' => true, 'data' => $customers] - , ['name' => "近{$days}日订单数", 'type' => 'line', 'stack' => '总量', 'smooth' => true, 'data' => $orders]]]; + $title = $days == 7 ? "近一周" : "近{$days}日"; + $data = ['title' => "{$title}走势图", 'legend_data' => ["客户数", "订单数"], 'xAxis' => $xAxis, + 'series' => [['name' => "客户数", 'type' => 'line', 'smooth' => true, 'data' => $customers] + , ['name' => "订单数", 'type' => 'line', 'smooth' => true, 'data' => $orders]]]; return $data; }