From 797108edfb2a48802b765cb9d8a7e781417499b7 Mon Sep 17 00:00:00 2001 From: lin fan Date: Fri, 22 Nov 2024 14:56:53 +0800 Subject: [PATCH] 1 --- api/controllers/wxapp/licheb/User.php | 12 ++++-------- common/libraries/receiver/Score_entity.php | 5 ++--- .../models/receiver/Receiver_score_config_model.php | 4 ++-- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/api/controllers/wxapp/licheb/User.php b/api/controllers/wxapp/licheb/User.php index b79f8869..ca6b3367 100644 --- a/api/controllers/wxapp/licheb/User.php +++ b/api/controllers/wxapp/licheb/User.php @@ -406,18 +406,14 @@ class User extends Wxapp $where_today_xs = ['biz_id' => $biz_id, 'status>=' => 0, 'p_time>=' => $s_today, 'p_time<=' => $e_today]; $where_month_xs = ['biz_id' => $biz_id, 'status>=' => 0, 'p_time>=' => $s_month, 'p_time<=' => $e_month]; //到店 - $where_today_dd = ['biz_id' => $biz_id, 'status>=' => 0, - "id in(select customer_id from lc_receiver_customer_oplogs where type=4 and uid in({$str_uids}) and c_time>=" . strtotime($s_today) . " and c_time<=" . strtotime($e_today) . ")" => null]; - $where_month_dd = ['biz_id' => $biz_id, 'status>=' => 0, - "id in(select customer_id from lc_receiver_customer_oplogs where type=4 and uid in({$str_uids}) and c_time>=" . strtotime($s_month) . " and c_time<=" . strtotime($e_month) . ")" => null]; + $where_today_dd = ['biz_id' => $biz_id, 'status>=' => 0, 'dt_time >= ' => $s_today, 'dt_time<=' => $e_today]; + $where_month_dd = ['biz_id' => $biz_id, 'status>=' => 0, 'dt_time >= ' => $s_month, 'dt_time<=' => $e_month]; //订单 $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, - "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, 'cs_biz_id<>' => -1, - "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]; + $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]; if ($group_id == 1) { $where_today_xs['admin_id'] = $uid; $where_month_xs['admin_id'] = $uid; diff --git a/common/libraries/receiver/Score_entity.php b/common/libraries/receiver/Score_entity.php index d60595fc..489b8777 100644 --- a/common/libraries/receiver/Score_entity.php +++ b/common/libraries/receiver/Score_entity.php @@ -225,11 +225,10 @@ class Score_entity } else { Receiver_score_log_model::add_score($uid, $biz_id, $day, $type, $sub_type, "{$desc}默认值", 1, 0, 0); } - } elseif ($sub_type == Receiver_score_config_model::TYPE_DEDUCT__TIMEOUT && $group_id == App_licheb_users_model::GROUP_BIZ) { + } elseif ($sub_type == Receiver_score_config_model::TYPE_DEDUCT_TIMEOUT && $group_id == App_licheb_users_model::GROUP_BIZ) { $receiverOrdersModel = new Receiver_orders_model(); $where = [ - 'status>=' => 0, 'biz_id' => $biz_id, 'apply_def_time!=' => '0000-00-00 00:00:00', 'if_defeat' => 1, - 'apply_def_time>=' => $day . ' 00:00:00', 'apply_def_time<=' => $day . ' 23:59:59' + 'status in (0,1)' => null, 'biz_id' => $biz_id, 'if_defeat' => 1, 'apply_def_time>=' => $day . ' 00:00:00', 'apply_def_time<=' => $day . ' 23:59:59' ]; $rows = $receiverOrdersModel->select($where, '', 1, 1000, 'id'); $desc = '战败申请当日未处理'; diff --git a/common/models/receiver/Receiver_score_config_model.php b/common/models/receiver/Receiver_score_config_model.php index 5c121627..c424c311 100644 --- a/common/models/receiver/Receiver_score_config_model.php +++ b/common/models/receiver/Receiver_score_config_model.php @@ -34,7 +34,7 @@ class Receiver_score_config_model extends HD_Model const TYPE_DEDUCT_ORDER_CTIME = 2; const TYPE_DEDUCT_VISIT_TIMEOUT = 3; const TYPE_DEDUCT_P_TIME_TIMEOUT = 4; - const TYPE_DEDUCT__TIMEOUT = 5; + const TYPE_DEDUCT_TIMEOUT = 5; const TYPE_BASE_LIST = [ self::TYPE_BASE_KG => '正常开工', @@ -58,7 +58,7 @@ class Receiver_score_config_model extends HD_Model self::TYPE_DEDUCT_VISIT_TIMEOUT => '线索逾期未跟进', //店长 self::TYPE_DEDUCT_P_TIME_TIMEOUT => '分配时间超过10分钟', - self::TYPE_DEDUCT__TIMEOUT => '战败申请当日未处理' + self::TYPE_DEDUCT_TIMEOUT => '战败申请当日未处理' ]; const STATUS_NORMAL = 1; //正常状态