From f8d660c84f739a70de8b0adfe8d029de6b051c32 Mon Sep 17 00:00:00 2001 From: xiaoyu Date: Sat, 29 Apr 2023 16:13:26 +0800 Subject: [PATCH] biz beforeorder beforeorder beforeorder --- home/controllers/h5/market/sylive2/Stic.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/home/controllers/h5/market/sylive2/Stic.php b/home/controllers/h5/market/sylive2/Stic.php index b7a3be32..423d1b07 100644 --- a/home/controllers/h5/market/sylive2/Stic.php +++ b/home/controllers/h5/market/sylive2/Stic.php @@ -146,18 +146,17 @@ class Stic extends Admin $biz_browse_count = $this->mdSytActivityKpiData->count($where); //浏览数据 $where['kpi'] = 'subscribe'; $biz_subscribe_count = $this->mdSytActivityKpiData->count($where); //订阅数据 - if ($this->a_id == 11) { - $where['kpi'] = 'order'; - } else { - $where['kpi'] = 'beforeOrder'; - } + $where['kpi'] = 'order'; $order_count = $this->mdSytActivityKpiData->count($where); //下单数据 + $biz = [ ['title' => '访问用户', 'num' => "{$biz_browse_count}人", 'url' => "/h5/market/sylive2/stic/users?type=biz&type_id={$group_user['bizId']}&kpi=browse"], ]; if ($this->a_id == 11) { - $biz[] = ['title' => '留资用户', 'num' => "{$order_count}人", 'url' => "/h5/market/sylive2/stic/users?type=biz&type_id={$group_user['bizId']}&kpi=subscribe"]; - $biz[] = ['title' => '留资率', 'num' => $order_count ? round($order_count / $biz_browse_count * 100, 2) . "%" : 0]; + $where['kpi'] = 'beforeOrder'; + $before_order_count = $this->mdSytActivityKpiData->count($where); //留资数据 + $biz[] = ['title' => '留资用户', 'num' => "{$before_order_count}人", 'url' => "/h5/market/sylive2/stic/users?type=biz&type_id={$group_user['bizId']}&kpi=beforeOrder"]; + $biz[] = ['title' => '留资率', 'num' => $before_order_count ? round($before_order_count / $biz_browse_count * 100, 2) . "%" : 0]; } else { $biz[] = ['title' => '预约用户', 'num' => "{$biz_subscribe_count}人", 'url' => "/h5/market/sylive2/stic/users?type=biz&type_id={$group_user['bizId']}&kpi=subscribe"]; $biz[] = ['title' => '预约率', 'num' => $biz_browse_count ? round($biz_subscribe_count / $biz_browse_count * 100, 2) . "%" : 0]; @@ -363,7 +362,7 @@ class Stic extends Admin public function users() { $map_kpi_name = [ - 'browse' => '访问用户', 'subscribe' => '预约用户', 'order' => '下单数', 'watch' => '观看用户' + 'browse' => '访问用户', 'subscribe' => '预约用户', 'order' => '下单数', 'watch' => '观看用户','beforeOrder' => '留资客户' ]; $params = $this->input->get(); $row = $this->market_sylive_activity_model->get(['activityId' => $this->a_id]);