From 94e7bb0ca3b1b6d976b8c371f0b7e231a0c6eab9 Mon Sep 17 00:00:00 2001 From: lcc <805383944@qq.com> Date: Sun, 5 Oct 2025 10:28:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=90=86=E8=BD=A6=E5=AE=9D?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=89=8B=E6=9C=BA=E5=8F=B7=E8=84=B1=E6=95=8F?= =?UTF-8?q?=E5=92=8Ch5=E6=8F=90=E4=BA=A4=E8=A1=A5=E8=B4=B4=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=9F=AD=E4=BF=A1=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/controllers/wxapp/licheb/Customers.php | 21 +++++++++++++------ .../libraries/entity/AutoUserCouponEntity.php | 4 ++++ .../app/licheb/App_licheb_users_model.php | 18 ++++++++++++++++ 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/api/controllers/wxapp/licheb/Customers.php b/api/controllers/wxapp/licheb/Customers.php index 01a3cd52..b83c8a81 100644 --- a/api/controllers/wxapp/licheb/Customers.php +++ b/api/controllers/wxapp/licheb/Customers.php @@ -86,7 +86,7 @@ class Customers extends Wxapp 'id' => $row['id'], 'cid' => $row['cid'], 'name' => $row['name'], - 'mobile' => $this->get_mobile(['mobile' => $row['mobile'], 'rid' => $row['rid']]), + 'mobile' => $this->get_mobile(['mobile' => $row['mobile'], 'rid' => $row['rid'], 'un_lock' => $row['un_lock']]), 'complete_mobile' => $row['mobile'], 'tip' => $tip, 'is_top' => $row['is_top'], @@ -129,7 +129,7 @@ class Customers extends Wxapp $row['cf_pid'] && $paic_user = $this->app_paic_users_model->get(['id' => $row['cf_pid']]); $data['baseinfo'] = [ 'name' => ['value' => $row['name'], 'cn' => '客户姓名'], - 'mobile' => ['value' => $this->get_mobile(['mobile' => $row['mobile'], 'rid' => $row['rid']]), 'cn' => '客户电话'], + 'mobile' => ['value' => $this->get_mobile(['mobile' => $row['mobile'], 'rid' => $row['rid']]), 'cn' => '客户电话', 'un_lock' => $row['un_lock']], // 'c_brand' => $row['c_brand'], 'of_id' => ['value' => $of_title, 'of_id' => intval($row['of_id']), 'of2_id' => intval($row['of2_id']), 'cn' => '客户来源', 'edit_status' => $edit_status], 'buy_time' => ['value' => $row['buy_time'], 'cn' => '预计购车时间'], @@ -1015,7 +1015,7 @@ class Customers extends Wxapp } $tip = $status_name[$val['status']] ? $status_name[$val['status']] : ''; $left_time = 0; - $mobile = $this->get_mobile(['mobile' => $val['mobile'], 'rid' => $val['rid']]); + $mobile = $this->get_mobile(['mobile' => $val['mobile'], 'rid' => $val['rid'], 'un_lock' => $val['un_lock']]); if ($param['biz_type'] == Biz_model::BIZ_TYPE_4s) { !$param['un_lock'] && $mobile = mobile_asterisk($mobile); $rec_time = strtotime($val['rec_time']); @@ -1355,7 +1355,7 @@ class Customers extends Wxapp $lists[] = [ 'id' => $val['id'], 'name' => $val['name'], - 'mobile' => $this->get_mobile(['mobile' => $val['mobile'], 'rid' => $val['rid']]), + 'mobile' => $this->get_mobile(['mobile' => $val['mobile'], 'rid' => $val['rid'], 'un_lock' => $val['un_lock']]), 'reason' => $reason, ]; } @@ -1448,11 +1448,20 @@ class Customers extends Wxapp private function get_mobile($params) { $mobile = $params['mobile']; - return $mobile; if (!$mobile) { return ''; } elseif ($params['rid']) { - return mobile_asterisk($mobile); + $biz_type = $this->get_biz('type'); + if ($biz_type != Biz_model::BIZ_TYPE_4s) { //非4s店都脱敏 + return mobile_asterisk($mobile); + } else { + $clues = $this->clues_model->get(array('id' => $params['rid'])); + if ($clues['app_id'] == Receiver_clues_model::APP_ID_ACTIVITY && $params['un_lock'] == 1) { //来源活动报名且解锁 + return $mobile; + } else { + return mobile_asterisk($mobile); + } + } } else { return $mobile; } diff --git a/common/libraries/entity/AutoUserCouponEntity.php b/common/libraries/entity/AutoUserCouponEntity.php index 7dde6125..a9cd5f94 100644 --- a/common/libraries/entity/AutoUserCouponEntity.php +++ b/common/libraries/entity/AutoUserCouponEntity.php @@ -166,6 +166,10 @@ class AutoUserCouponEntity //跟新客户为订单客户 $this->ci->receiver_customers_model->update(['status' => 2], ['id' => $customersRow['id']]); $this->ci->db->trans_commit(); + //发送短信给店长 + $this->ci->load->model('app/licheb/app_licheb_users_model'); + $this->ci->app_licheb_users_model->set_db('ssdb'); + $this->ci->app_licheb_users_model->sendSmsToManager($bizId, "门店新增了一个订单,请及时到小程序“理车宝-订单”进行处理。"); return new MyRESPONSE(EXIT_SUCCESS, '核销成功'); } catch (Exception $e) { $this->ci->db->trans_rollback(); diff --git a/common/models/app/licheb/App_licheb_users_model.php b/common/models/app/licheb/App_licheb_users_model.php index 1cce6981..387f685a 100644 --- a/common/models/app/licheb/App_licheb_users_model.php +++ b/common/models/app/licheb/App_licheb_users_model.php @@ -43,4 +43,22 @@ class App_licheb_users_model extends HD_Model { return $this->group_arr; } + + /** + * 给店长发短信 + * @param $bizId + * @param $content + * @return true + */ + public function sendSmsToManager($bizId, $content) + { + $where = array('biz_id' => $bizId, 'status' => 1, 'group_id' => 2); + $res_u = $this->select($where); + if ($res_u) { + foreach ($res_u as $v) { + ems_sms($v['mobile'], $content); + } + } + return true; + } }