From 32b8397ac800fd6603aa2707689ccf31d111260d Mon Sep 17 00:00:00 2001 From: lcc <805383944@qq.com> Date: Mon, 11 Aug 2025 17:23:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=9C=8B=E6=9D=BF=E6=95=B0=E6=8D=AE=E5=92=8C?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/controllers/wxapp/licheb/Customers.php | 3 +++ api/controllers/wxapp/licheb/User.php | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/api/controllers/wxapp/licheb/Customers.php b/api/controllers/wxapp/licheb/Customers.php index 1d34280d..96db1957 100644 --- a/api/controllers/wxapp/licheb/Customers.php +++ b/api/controllers/wxapp/licheb/Customers.php @@ -1237,6 +1237,7 @@ class Customers extends Wxapp } } $group_id == 1 && $where['a.admin_id'] = $this->myuid; + $biz_type == Biz_model::BIZ_TYPE_4s && $where['a.un_lock'] = 1; $count = $this->mdCustomerVisitData->count_visit($where); } else {//数据看板 数据列表 if ($tab_id == 2) {//今日 @@ -1250,6 +1251,7 @@ class Customers extends Wxapp $where = ['biz_id' => $this->biz_id, 'status>=' => 0, 'p_time>=' => $s_c_time , 'p_time<=' => $e_c_time]; $group_id == 1 && $where['admin_id'] = $this->myuid; + $biz_type == Biz_model::BIZ_TYPE_4s && $where['un_lock'] = 1; $count = $this->customers_model->count($where); } else if ($visit == 5 || $visit == 7) {//今日/本月到店/战败 $oplogs_type = $visit == 7 ? 7 : 4;//4到店7战败 @@ -1267,6 +1269,7 @@ class Customers extends Wxapp } !$str_uids && $str_uids = '-1'; $where["(of2_id = 10 and c_time>={$s_c_time} and c_time<={$e_c_time}) OR id in(select customer_id from lc_receiver_customer_oplogs where type={$oplogs_type} and uid in({$str_uids}) and c_time>={$s_c_time} and c_time<={$e_c_time})"] = null; + $biz_type == Biz_model::BIZ_TYPE_4s && $where['un_lock'] = 1; $count = $this->customers_model->count($where); } } diff --git a/api/controllers/wxapp/licheb/User.php b/api/controllers/wxapp/licheb/User.php index d66ca176..e00b55f7 100644 --- a/api/controllers/wxapp/licheb/User.php +++ b/api/controllers/wxapp/licheb/User.php @@ -427,8 +427,22 @@ class User extends Wxapp $where_today_order = ['biz_id' => $biz_id, 'status>=' => 0, 'c_time>=' => strtotime($s_today), 'c_time<=' => strtotime($e_today)]; $where_month_order = ['biz_id' => $biz_id, 'status>=' => 0, 'c_time>=' => strtotime($s_month), 'c_time<=' => strtotime($e_month)]; //战败 - $where_today_defeat = ['biz_id' => $biz_id, 'status>=' => 0, 'cs_biz_id<>' => -1, 'def_time >= ' => $s_today, 'def_time<=' => $e_today]; - $where_month_defeat = ['biz_id' => $biz_id, 'status>=' => 0, 'cs_biz_id<>' => -1, 'def_time >= ' => $s_month, 'def_time<=' => $e_month]; + $where_today_defeat = [ + 'biz_id' => $biz_id, 'status>=' => 0 + ]; + $str_uids = ''; + if ($group_id == 1) { + $str_uids = $this->myuid; + } else { + $res_user = $this->app_user_model->select(['biz_id' => $biz_id, 'group_id <' => 4, 'status>=' => 0], 'id asc', 0, 0, 'id,userid'); + foreach ($res_user as $k => $v) { + $str_uids = $str_uids ? $str_uids . ',' . $v['id'] : $v['id']; + } + } + !$str_uids && $str_uids = '-1'; + $where_today_defeat["(of2_id = 10 and c_time>=" . strtotime($s_today) . " and c_time<=" . strtotime($e_today) . ") OR id in(select customer_id from lc_receiver_customer_oplogs where type=7 and uid in({$str_uids}) and c_time>=" . strtotime($s_today) . " and c_time<=" . strtotime($e_today) . ")"] = null; + $where_month_defeat = ['biz_id' => $biz_id, 'status>=' => 0]; + $where_month_defeat["(of2_id = 10 and c_time>=" . strtotime($s_month) . " and c_time<=" . strtotime($e_month) . ") OR id in(select customer_id from lc_receiver_customer_oplogs where type=7 and uid in({$str_uids}) and c_time>=" . strtotime($s_month) . " and c_time<=" . strtotime($e_month) . ")"] = null; if ($group_id == 1) { $where_today_xs['admin_id'] = $uid; $where_month_xs['admin_id'] = $uid;