diff --git a/admin/controllers/receiver/Customer.php b/admin/controllers/receiver/Customer.php index 24755f86..e2a7bb10 100644 --- a/admin/controllers/receiver/Customer.php +++ b/admin/controllers/receiver/Customer.php @@ -161,6 +161,22 @@ class Customer extends HD_Controller $order_time[0] && $where["order_time >="] = $order_time[0] . ' 00:00:00'; $order_time[1] && $where["order_time <="] = $order_time[1] . ' 23:59:59'; } + if ($params['cfrom_id'] || $params['cfrom_id2']) { + if ($params['cfrom_id'] == 24) { + $where['cf_id'] = 24; + $params['cfrom_id2'] && $where['t_id'] = $params['cfrom_id2']; + } else { + if ($params['cfrom_id2']) { + $where['cf_id'] = $params['cfrom_id2']; + } else { + $cf_rows = $this->clues_cfrom_model->select(['pid' => $params['cfrom_id']], '', '', '', 'id'); + $cf_ids = array_column($cf_rows, 'id'); + $cf_ids[] = $params['cfrom_id']; + $cf_str_ids = implode(',', array_filter($cf_ids)); + $cf_str_ids && $where["cf_id in ({$cf_str_ids})"] = null; + } + } + } $count = $this->customers_model->count($where); $lists = []; $offlineSources = $this->customers_model->offlineSources();