diff --git a/application/crm/controller/Message.php b/application/crm/controller/Message.php index ccfc0fd..77ea20d 100644 --- a/application/crm/controller/Message.php +++ b/application/crm/controller/Message.php @@ -609,14 +609,13 @@ class Message extends ApiCommon unset($param['type']); unset($param['isSub']); $businessModel = model('Business'); - $param['owner_user_id'] = $userInfo['id']; +// $param['owner_user_id'] = $userInfo['id']; if ($isSub) { $param['owner_user_id'] = array('in', getSubUserId(false)); } - $businessIdArray = db('crm_dealt_relation')->where(['types' => ['eq', 'crm_business_new'], 'user_id' => ['eq', $param['user_id']]])->column('types_id'); + $businessIdArray = db('crm_dealt_relation')->where(['types' => ['eq', 'crm_business_new'], 'user_id' => ['eq', $userInfo['id']]])->column('types_id'); $param['businessIdArray'] = !empty($businessIdArray) ? $businessIdArray : -1; $data = $businessModel->getDataList($param); -// p($contractModel->getLastSql()); if ($types == 'list') { return resultArray(['data' => $data]); } @@ -776,7 +775,7 @@ class Message extends ApiCommon } # 处理待审核合同、回款、发票 - if (in_array($type, ['checkContract', 'checkReceivables', 'checkInvoice', 'checkBusiness','checkCustomerCheck','new_business'])) { + if (in_array($type, ['checkContract', 'checkReceivables', 'checkInvoice', 'checkBusiness', 'checkCustomerCheck', 'new_business'])) { $where['check_status'] = ['lt', '2']; $where['check_user_id'] = ['like', ',%' . $userId . '%,']; diff --git a/application/crm/model/Business.php b/application/crm/model/Business.php index ca8352c..f7966aa 100644 --- a/application/crm/model/Business.php +++ b/application/crm/model/Business.php @@ -438,7 +438,8 @@ class Business extends Common db('crm_business_data')->insertAll($businessData); //站内信 - $send_user_id = stringToArray(getUserSuperior($param['create_user_id'])); + $userInfo = db('admin_user')->where(['id' => $param['create_user_id']])->find(); + $send_user_id = stringToArray(getUserSuperior($userInfo['structure_id'],0)); (new Message())->send( Message::CUSTOMER_CHECK_TO_DO, [