Compare commits

...

12 Commits

@ -22,7 +22,7 @@ class ExamineFlow extends Common
protected $createTime = 'create_time';
protected $updateTime = 'update_time';
protected $autoWriteTimestamp = true;
protected $typesArr = ['crm_contract', 'crm_receivables', 'crm_invoice', 'oa_examine', 'jxc_purchase', 'jxc_retreat', 'jxc_sale', 'jxc_salereturn', 'jxc_payment', 'jxc_collection', 'jxc_allocation', 'jxc_inventory'];
protected $typesArr = ['crm_customer_check', 'crm_business','crm_contract', 'crm_receivables', 'crm_invoice', 'oa_examine', 'jxc_purchase', 'jxc_retreat', 'jxc_sale', 'jxc_salereturn', 'jxc_payment', 'jxc_collection', 'jxc_allocation', 'jxc_inventory'];
/**
* [getDataList 审批流程list]

@ -9,6 +9,7 @@ namespace app\admin\model;
use app\admin\model\ImportRecord as ImportRecordModel;
use app\admin\model\User as UserModel;
use app\crm\model\Contract as ContractModel;
use app\crm\model\CustomerCheck;
use app\crm\model\Invoice;
use app\crm\model\Receivables as ReceivablesModel;
use app\oa\model\Announcement as AnnouncementModel;
@ -265,6 +266,18 @@ class Message extends Common
* 盘点审批通过
*/
const INVENTORY_PASS = 56;
/**
* 客户待审批
*/
const CUSTOMER_CHECK_TO_DO = 57;
/**
* 客户待审批
*/
const CUSTOMER_CHECK_REJECT = 58;
/**
* 客户待审批
*/
const CUSTOMER_CHECK_PASS = 59;
/**
* 消息类型
@ -423,6 +436,9 @@ class Message extends Common
self::BUSINESS_PASS,
self::CUSTOMER_PASS,
self::CONTRACT_END,
self::CUSTOMER_CHECK_TO_DO,
self::CUSTOMER_CHECK_REJECT,
self::CUSTOMER_CHECK_PASS,
],
'jxc' => [
self::PURCHASE_TO_DO,
@ -482,7 +498,7 @@ class Message extends Common
foreach ($data as $key => $val) {
$content = str_replace('{' . $key . '}', $val, $content);
}
$advance_time= $data['advance_time'];
$advance_time = $data['advance_time'];
$content = str_replace('{from_user}', User::userInfo('realname'), $content);
$content = str_replace('{date}', date('Y-m-d'), $content);
$data = [];
@ -499,7 +515,7 @@ class Message extends Common
$data['action_name'] = strtolower($request->action());
$from_user_id = $data['from_user_id'];
if (!in_array($type,[9,17,18,19,20,27])) {
if (!in_array($type, [9, 17, 18, 19, 20, 27])) {
$user_id_list = array_filter($user_id_list, function ($val) use ($from_user_id) {
return $val !== $from_user_id;
});
@ -559,6 +575,11 @@ class Message extends Common
case self::CONTRACT_PASS:
case self::TEAM_CONTRACT:
return ContractModel::where(['contract_id' => $data['action_id']])->value('name') ?: '';
// 客户
case self::CUSTOMER_CHECK_TO_DO:
case self::CUSTOMER_CHECK_PASS:
case self::CUSTOMER_CHECK_REJECT:
return CustomerCheck::where(['customer_check_id' => $data['action_id']])->value('name') ?: '';
// 回款
case self::RECEIVABLES_TO_DO:

@ -9,6 +9,8 @@
namespace app\crm\controller;
use app\admin\controller\ApiCommon;
use app\admin\model\Message;
use app\admin\model\User;
use app\crm\logic\CustomerPoolLogic;
use think\Hook;
use think\Request;
@ -172,7 +174,7 @@ class CustomerPool extends ApiCommon
$param = $this->param;
$param['user_id'] = $this->userInfo['id'];
$result = (new CustomerPoolLogic())->receiveCustomers($param);
$result = (new CustomerPoolLogic())->customerReceiveExamine($param);
if (!empty($result)) return resultArray(['error' => $result]);
@ -398,4 +400,139 @@ class CustomerPool extends ApiCommon
$pool_list=array_merge($pool_list,$list);
return $pool_list;
}
/**
* 领取公海池客户
*
* @return Json
* @since 2021-04-15
* @author fanqi
*/
public function checkCustomerReveive()
{
$param = $this->param;
$userInfo = $this->userInfo;
$user_id = $userInfo['id'];
$customerCheckModel = model('CustomerCheck');
$examineStepModel = new \app\admin\model\ExamineStep();
$examineRecordModel = new \app\admin\model\ExamineRecord();
$examineFlowModel = new \app\admin\model\ExamineFlow();
$customerModel = model('Customer');
$customerCheckData = [];
$customerCheckData['update_time'] = time();
$customerCheckData['check_status'] = 1; //0待审核1审核通中2审核通过3审核未通过
//权限判断
if (!$examineStepModel->checkExamine($user_id, 'crm_contract', $param['id'])) {
return resultArray(['error' => $examineStepModel->getError()]);
}
//审批主体详情
$dataInfo = db('crm_customer_check')->where('customer_check_id', 'in', $param['customer_check_id'])->find();
$flowInfo = $examineFlowModel->getDataById($dataInfo['flow_id']);
$is_end = 0; // 1审批结束
$status = $param['status'] ? 1 : 0; //1通过0驳回
$checkData = [];
$checkData['check_user_id'] = $user_id;
$checkData['types'] = 'crm_customer_check';
$checkData['types_id'] = $param['id'];
$checkData['check_time'] = time();
$checkData['content'] = $param['content'];
$checkData['flow_id'] = $dataInfo['flow_id'];
$checkData['order_id'] = $dataInfo['order_id'] ? : 1;
$checkData['status'] = $status;
if ($status == 1) {
if ($flowInfo['config'] == 1) {
//固定流程
//获取下一审批信息
$nextStepData = $examineStepModel->nextStepUser($dataInfo['owner_user_id'], $dataInfo['flow_id'], 'crm_customer_check', $param['id'], $dataInfo['order_id'], $user_id);
$next_user_ids = $nextStepData['next_user_ids'] ? : [];
$customerCheckData['order_id'] = $nextStepData['order_id'] ? : '';
if (!$next_user_ids) {
$is_end = 1;
//审批结束
$checkData['check_status'] = !empty($status) ? 2 : 3;
$customerCheckData['check_user_id'] = '';
} else {
//修改主体相关审批信息
$customerCheckData['check_user_id'] = arrayToString($next_user_ids);
}
} else {
//自选流程
$is_end = $param['is_end'] ? 1 : '';
$check_user_id = $param['check_user_id'] ? : '';
if ($is_end !== 1 && empty($check_user_id)) {
return resultArray(['error' => '请选择下一审批人']);
}
$customerCheckData['check_user_id'] = arrayToString($param['check_user_id']);
}
if ($is_end == 1) {
$checkData['check_status'] = !empty($status) ? 2 : 3;
$customerCheckData['check_user_id'] = '';
$customerCheckData['check_status'] = 2;
}
} else {
//审批驳回
$is_end = 1;
$customerCheckData['check_status'] = 3;
//将审批记录至为无效
// $examineRecordModel->setEnd(['types' => 'crm_contract','types_id' => $param['id']]);
}
//已审批人ID
$customerCheckData['flow_user_id'] = stringToArray($dataInfo['flow_user_id']) ? arrayToString(array_merge(stringToArray($dataInfo['flow_user_id']),[$user_id])) : arrayToString([$user_id]);
$resCustomerCheck = db('crm_customer_check')->where(['customer_check_id' => $param['id']])->update($customerCheckData);
if ($resCustomerCheck) {
//审批记录
$resRecord = $examineRecordModel->createData($checkData);
//审核通过,修改相关信息
if ($is_end == 1 && !empty($status)) {
// 审批通过消息告知负责人
(new Message())->send(
Message::CONTRACT_PASS,
[
'title' => $dataInfo['name'],
'action_id' => $param['id']
],
$dataInfo['owner_user_id']
);
$customerData = [];
$customerData['user_id']=$dataInfo['user_id'];
$customerData['customer_id']=$dataInfo['customer_id'];
$result = (new CustomerPoolLogic())->receiveCustomers($customerData);
if (!empty($result)) return resultArray(['error' => $result]);
return resultArray(['data' => '领取成功!']);
} else {
if ($status) {
//发送站内信
// 通过未完成,发送消息给
(new Message())->send(
Message::CUSTOMER_CHECK_TO_DO,
[
'from_user' => User::where(['id' => $dataInfo['owner_user_id']])->value('realname'),
'title' => $dataInfo['name'],
'action_id' => $param['id']
],
stringToArray($customerCheckData['check_user_id'])
);
} else {
(new Message())->send(
Message::CONTRACT_REJECT,
[
'title' => $dataInfo['name'],
'action_id' => $param['id']
],
$dataInfo['owner_user_id']
);
}
}
return resultArray(['data' => '审批成功']);
} else {
return resultArray(['error' => '审批失败,请重试!']);
}
}
}

@ -185,6 +185,19 @@ class Message extends ApiCommon
cache('checkBusinessCount' . $userInfo['id'], $data['checkBusiness']);
cache('checkBusinessTime' . $userInfo['id'], time());
}
# 待审核客户捞取
$checkCustomerCheckTime = cache('$checkCustomerCheckTime' . $userInfo['id']);
$checkCustomerCheckCount = cache('checkCustomerCheckCount' . $userInfo['id']);
if (time() <= $checkCustomerCheckTime) {
$data['checkCustomerCheck'] = (int)$checkCustomerCheckCount;
} else {
$checkCustomerCheck = $this->checkCustomerCheck(true);
$data['checkCustomerCheck'] = $checkCustomerCheck['dataCount'] ?: 0;
cache('checkCustomerCheckCount' . $userInfo['id'], $data['checkCustomerCheck']);
cache('$checkCustomerCheckTime' . $userInfo['id'], time());
}
# 待回款提醒
$remindReceivablesPlanTime = cache('remindReceivablesPlanTime' . $userInfo['id']);
$remindReceivablesPlanCount = cache('remindReceivablesPlanCount' . $userInfo['id']);
@ -461,6 +474,29 @@ class Message extends ApiCommon
return $data;
}
/**
* 待审核客户捞取
*
* @return array|\think\response\Json
* @throws \think\exception\DbException
*/
public function checkCustomerCheck($getCount = false)
{
$param = $this->param;
$userId = $this->userInfo['id'];
$types = $param['types'];
if ($getCount == true) $param['getCount'] = 1;
# 清除与模型无关的数据
unset($param['types']);
$param['user_id'] = $userId;
$messageLogic = new MessageLogic();
$data = $messageLogic->checkCustomerCheck($param);
if ($types == 'list') return resultArray(['data' => $data]);
return $data;
}
/**
* 待回款提醒
* @return

@ -12,7 +12,9 @@ use app\admin\model\ActionRecord;
use app\admin\model\Common;
use app\admin\model\Field;
use app\admin\model\File;
use app\admin\model\Message;
use app\admin\model\Record;
use app\admin\model\User;
use app\crm\model\CustomerConfig;
use PDOStatement;
use think\Collection;
@ -25,9 +27,9 @@ class CustomerPoolLogic extends Common
* 公海列表
*
* @param $param
* @author fanqi
* @since 2021-04-14
* @return array
* @since 2021-04-14
* @author fanqi
*/
public function getPoolList($param)
{
@ -46,10 +48,10 @@ class CustomerPoolLogic extends Common
$searchMap = [];
if ($param['search'] == '0' || !empty($param['search'])) {
$search = $param['search'];
$searchMap = function($query) use ($search) {
$query->where('customer.name',array('like','%'.$search.'%'))
->whereOr('customer.mobile',array('like','%'.$search.'%'))
->whereOr('customer.telephone',array('like','%'.$search.'%'));
$searchMap = function ($query) use ($search) {
$query->where('customer.name', array('like', '%' . $search . '%'))
->whereOr('customer.mobile', array('like', '%' . $search . '%'))
->whereOr('customer.telephone', array('like', '%' . $search . '%'));
};
}
@ -60,11 +62,11 @@ class CustomerPoolLogic extends Common
}
// 公海条件
if ($param['is_excel'] == 1 && !empty($param['customer_id'])) {
$authMap['customer.customer_id'] = ['in', trim(arrayToString($param['customer_id']),',')];
$authMap['customer.customer_id'] = ['in', trim(arrayToString($param['customer_id']), ',')];
}
// 排序
if (!empty($orderField) && !empty($orderType)) {
$order = $fieldModel->getOrderByFormtype('crm_customer','customer', $orderField, $orderType);
$order = $fieldModel->getOrderByFormtype('crm_customer', 'customer', $orderField, $orderType);
} else {
$order = 'customer.update_time desc';
}
@ -76,7 +78,7 @@ class CustomerPoolLogic extends Common
unset($param['is_excel']);
unset($param['customer_id']);
// 格式化参数
$request = $this->fmtRequest( $param );
$request = $this->fmtRequest($param);
$requestMap = !empty($request['map']) ? $request['map'] : [];
// 高级搜索
@ -114,12 +116,12 @@ class CustomerPoolLogic extends Common
$extraData = [];
$customerIds = array_column($customerPoolList, 'customer_id');
$extraList = db('crm_customer_data')->whereIn('customer_id', $customerIds)->select();
foreach ($extraList AS $key => $value) {
foreach ($extraList as $key => $value) {
$extraData[$value['customer_id']][$value['field']] = $value['content'];
}
// 整理公海数据
foreach ($customerPoolList AS $key => $value) {
foreach ($customerPoolList as $key => $value) {
$customerPoolList[$key]['create_user_name'] = !empty($userData[$value['create_user_id']]) ? $userData[$value['create_user_id']] : '';
$customerPoolList[$key]['before_owner_user_name'] = !empty($userData[$value['before_owner_user_id']]) ? $userData[$value['before_owner_user_id']] : '';
@ -130,38 +132,38 @@ class CustomerPoolLogic extends Common
$customerPoolList[$key]['into_pool_time'] = !empty($value['into_pool_time']) ? date('Y-m-d H:i:s', $value['into_pool_time']) : null;
// 处理日期时间类型的自定义字段
foreach ($datetimeField AS $k => $v) {
foreach ($datetimeField as $k => $v) {
if (!empty($value[$v])) $customerPoolList[$key][$v] = date('Y-m-d H:i:s', $value[$v]);
}
// 处理人员类型的自定义字段
foreach ($userField AS $k => $v) {
foreach ($userField as $k => $v) {
if (!empty($value[$v])) {
$customerPoolList[$key][$v] = $this->fieldTransformToText($value[$v], $userData);
}
}
// 处理部门类型的自定义字段
foreach ($structureField AS $k => $v) {
foreach ($structureField as $k => $v) {
if (!empty($value[$v])) $customerPoolList[$key][$v] = $this->fieldTransformToText($value[$v], $structureData);
}
// 布尔值类型字段
foreach ($booleanField AS $k => $v) {
foreach ($booleanField as $k => $v) {
$customerPoolList[$key][$v] = !empty($value[$v]) ? (string)$value[$v] : '0';
}
// 处理日期区间类型字段的格式
foreach ($dateIntervalField AS $k => $v) {
foreach ($dateIntervalField as $k => $v) {
$customerPoolList[$key][$v] = !empty($extraData[$value['customer_id']][$v]) ? json_decode($extraData[$value['customer_id']][$v], true) : null;
}
// 处理地址类型字段的格式
foreach ($positionField AS $k => $v) {
foreach ($positionField as $k => $v) {
$customerPoolList[$key][$v] = !empty($extraData[$value['customer_id']][$v]) ? json_decode($extraData[$value['customer_id']][$v], true) : null;
}
// 手写签名类型字段
foreach ($handwritingField AS $k => $v) {
foreach ($handwritingField as $k => $v) {
$handwritingData = !empty($value[$v]) ? db('admin_file')->where('file_id', $value[$v])->value('file_path') : null;
$customerPoolList[$key][$v] = ['url' => !empty($handwritingData) ? getFullPath($handwritingData) : null];
}
// 定位类型字段
foreach ($locationField AS $k => $v) {
foreach ($locationField as $k => $v) {
$customerPoolList[$key][$v] = !empty($extraData[$value['customer_id']][$v]) ? json_decode($extraData[$value['customer_id']][$v], true) : null;
}
}
@ -176,9 +178,9 @@ class CustomerPoolLogic extends Common
* 公海详情
*
* @param array $param pool_id 公海IDcustomer_id 客户ID
* @author fanqi
* @since 2021-04-14
* @return array|bool|PDOStatement|string|Model|null
* @since 2021-04-14
* @author fanqi
*/
public function getPoolData($param)
{
@ -214,19 +216,19 @@ class CustomerPoolLogic extends Common
$data['into_pool_time'] = !empty($data['into_pool_time']) ? date('Y-m-d H:i:s', $data['into_pool_time']) : null;
# 处理日期时间类型的自定义字段
foreach ($datetimeField AS $k => $v) {
foreach ($datetimeField as $k => $v) {
if (isset($data[$v])) {
$data[$v] = !empty($data[$v]) ? date('Y-m-d H:i:s', $data[$v]) : null;
}
}
# 处理人员类型的自定义字段
foreach ($userField AS $k => $v) {
foreach ($userField as $k => $v) {
if (isset($data[$v]) && !empty($data[$v])) {
$data[$v] = $this->fieldTransformToText($data[$v], $userData);
}
}
# 处理部门类型的自定义字段
foreach ($structureField AS $k => $v) {
foreach ($structureField as $k => $v) {
if (isset($data[$v]) && !empty($data[$v])) {
$data[$v] = $this->fieldTransformToText($data[$v], $structureData);
}
@ -252,7 +254,7 @@ class CustomerPoolLogic extends Common
$customerData = $this->getCustomerList($customerId);
# 验证是否是公海数据
foreach ($customerId AS $key => $value) {
foreach ($customerId as $key => $value) {
if (empty($customerData[$value])) {
$message[] = '删除 《' . $customerData[$value]['name'] . '》 失败,原因:公海客户不存在!';
@ -275,7 +277,7 @@ class CustomerPoolLogic extends Common
$customerContractData = db('crm_contract')->whereIn('customer_id', $customerId)->column('customer_id');
# 验证客户下是否存在联系人、商机、合同
foreach ($customerId AS $key => $value) {
foreach ($customerId as $key => $value) {
if (in_array($value, $customerContactsData)) {
$message[] = '删除 《' . $customerData[$value]['name'] . '》 失败,原因:客户下存在联系人!';
@ -307,13 +309,13 @@ class CustomerPoolLogic extends Common
# 记录到数据操作日志
$ip = request()->ip();
$addOperationLogData = [];
foreach ($customerId AS $key => $value) {
foreach ($customerId as $key => $value) {
$addOperationLogData[] = [
'user_id' => $param['user_id'],
'client_ip' => $ip,
'module' => 'crm_customer',
'action_id' => $value,
'content' => '删除了客户:' . $customerData[$value]['name'],
'user_id' => $param['user_id'],
'client_ip' => $ip,
'module' => 'crm_customer',
'action_id' => $value,
'content' => '删除了客户:' . $customerData[$value]['name'],
'create_time' => time(),
'action_name' => 'delete',
'target_name' => $customerData[$value]['name']
@ -332,9 +334,9 @@ class CustomerPoolLogic extends Common
* 获取公海池列表
*
* @param array $param 查询参数user_id 用户idstructure_id 部门id
* @author fanqi
* @since 2021-04-21
* @return bool|PDOStatement|string|Collection
* @since 2021-04-21
* @author fanqi
*/
public function getPondList($param)
{
@ -345,7 +347,7 @@ class CustomerPoolLogic extends Common
->where(function ($query) use ($param, $adminTypes) {
if (!in_array(1, $adminTypes)) $query->where('admin_user_ids', 'like', '%,' . $param['user_id'] . ',%');
if (!in_array(1, $adminTypes)) $query->whereOr('user_ids', 'like', '%,' . $param['user_id'] . ',%');
if (!in_array(1, $adminTypes)) $query->whereOr('department_ids', '%,' . $param['structure_id'] . ',%');
if (!in_array(1, $adminTypes)) $query->whereOr('department_ids', '%,' . $param['structure_id'] . ',%');
})->select();
}
@ -353,9 +355,9 @@ class CustomerPoolLogic extends Common
* 获取公海字段
*
* @param array $param pool_id 公海IDaction 操作类型action_id 数据id
* @author fanqi
* @since 2021-04-13
* @return array
* @since 2021-04-13
* @author fanqi
*/
public function getFieldList($param)
{
@ -363,14 +365,14 @@ class CustomerPoolLogic extends Common
# 自定义字段
$where = [
'pool_id' => $param['pool_id'],
'pool_id' => $param['pool_id'],
'is_hidden' => 0,
'form_type' => ['notin', ['file', 'desc_text', 'detail_table']]
];
$list = db('crm_customer_pool_field_setting')->where($where)->select();
# 处理公海字段
foreach ($list AS $key => $value) {
foreach ($list as $key => $value) {
$list[$key]['field'] = $value['field_name'];
# 处理别名
@ -392,12 +394,12 @@ class CustomerPoolLogic extends Common
}
$data[$list[$key]['field']] = [
'field' => $list[$key]['field'],
'field' => $list[$key]['field'],
'fieldName' => $list[$key]['fieldName'],
'name' => $list[$key]['name'],
'width' => '',
'name' => $list[$key]['name'],
'width' => '',
'is_hidden' => 1,
'system' => $list[$key]['system'],
'system' => $list[$key]['system'],
'form_type' => $list[$key]['form_type']
];
}
@ -411,9 +413,9 @@ class CustomerPoolLogic extends Common
/**
* 高级筛选字段列表
*
* @author fanqi
* @since 2021-04-14
* @return array
* @since 2021-04-14
* @author fanqi
*/
public function getAdvancedFilterFieldList()
{
@ -434,7 +436,7 @@ class CustomerPoolLogic extends Common
$list = array_merge($list, $base);
# 整理数据
foreach ($list AS $key => $value) {
foreach ($list as $key => $value) {
if (!empty($value['setting'])) $list[$key]['setting'] = explode(chr(10), $value['setting']);
}
@ -603,16 +605,16 @@ class CustomerPoolLogic extends Common
* 分配客户
*
* @param array $param user_id 员工IDcustomer_id 客户ID
* @author fanqi
* @since 2021-04-15
* @return array
* @since 2021-04-15
* @author fanqi
*/
public function distributeCustomer($param)
{
# 查询参数
$userId = $param['user_id'];
$userId = $param['user_id'];
$customerId = $param['customer_id'];
$username = db('admin_user')->where('id', $userId)->value('realname');
$username = db('admin_user')->where('id', $userId)->value('realname');
# 消息数据
$message = [];
@ -621,7 +623,7 @@ class CustomerPoolLogic extends Common
$customerData = $this->getCustomerList($customerId);
# 剔除非公海客户
foreach ($customerId AS $key => $value) {
foreach ($customerId as $key => $value) {
if (!empty($customerData[$value]['owner_user_id'])) {
$message[] = '将客户《' . $customerData[$value]['name'] . '》分配给员工' . $username . '失败,失败原因:不是公海客户!';
@ -641,7 +643,7 @@ class CustomerPoolLogic extends Common
$failCustomer = [];
if (!is_bool($exceedCount) && !empty($exceedCount) && $exceedCount > 0) {
$failCustomer = array_slice($customerId, count($customerId) - $exceedCount);
foreach ($failCustomer AS $key => $value) {
foreach ($failCustomer as $key => $value) {
$message[] = '将客户《' . $customerData[$value]['name'] . '》分配给员工' . $username . '失败,失败原因:持有客户数达到上限!';
}
}
@ -652,16 +654,16 @@ class CustomerPoolLogic extends Common
# 检查是否还有要领取的客户
if (empty($addCustomerId)) return $message;
# 查询分配客户的公海id
$poolId=db('crm_customer_pool_relation')->whereIn('customer_id',$customerId)->value('pool_id');
$poolId = db('crm_customer_pool_relation')->whereIn('customer_id', $customerId)->value('pool_id');
# 整理客户更新数据
$addCustomerData = [
'owner_user_id' => $userId,
'owner_user_id' => $userId,
'before_owner_user_id' => 0,
'into_pool_time' => 0,
'obtain_time' => time(),
'is_dealt' => 0,
'is_allocation' => 1,
'follow' => '待跟进'
'into_pool_time' => 0,
'obtain_time' => time(),
'is_dealt' => 0,
'is_allocation' => 1,
'follow' => '待跟进'
];
# 整理字段操作记录和数据日志的数据
@ -669,29 +671,29 @@ class CustomerPoolLogic extends Common
$addActionRecordData = [];
$addOperationLogData = [];
$addReceiveData = [];
foreach ($addCustomerId AS $key => $value) {
foreach ($addCustomerId as $key => $value) {
$addActionRecordData[] = [
'user_id' => $userId,
'types' => 'crm_customer',
'action_id' => $value,
'content' => '将客户 ' . $customerData[$value]['name'] . ' 分配给员工 ' . $username,
'user_id' => $userId,
'types' => 'crm_customer',
'action_id' => $value,
'content' => '将客户 ' . $customerData[$value]['name'] . ' 分配给员工 ' . $username,
'create_time' => time()
];
$addOperationLogData[] = [
'user_id' => $userId,
'client_ip' => $ip,
'module' => 'crm_customer',
'action_id' => $value,
'content' => '将客户 ' . $customerData[$value]['name'] . ' 分配给员工 ' . $username,
'user_id' => $userId,
'client_ip' => $ip,
'module' => 'crm_customer',
'action_id' => $value,
'content' => '将客户 ' . $customerData[$value]['name'] . ' 分配给员工 ' . $username,
'create_time' => time(),
'action_name' => 'update',
'target_name' => $customerData[$value]['name']
];
$addReceiveData[] = [
'customer_id' => $value,
'user_id' => $userId,
'pool_id' => $poolId,
'type' => 3,
'user_id' => $userId,
'pool_id' => $poolId,
'type' => 3,
'create_time' => time()
];
}
@ -730,26 +732,26 @@ class CustomerPoolLogic extends Common
* 公海权限
*
* @param $param
* @author fanqi
* @since 2021-04-14
* @return array
* @since 2021-04-14
* @author fanqi
*/
public function getAuthorityData($param)
{
# 权限
$authority = [
'index' => false, # 列表
'receive' => false, # 领取
'distribute' => false, # 分配
'index' => false, # 列表
'receive' => false, # 领取
'distribute' => false, # 分配
'excelexport' => false, # 导出
'excelimport' => false, # 导入
'delete' => false, # 删除
'delete' => false, # 删除
];
if (empty($param['pool_id']) || empty($param['user_id']) || empty($param['structure_id'])) return $authority;
$poolId = $param['pool_id'];
$userId = $param['user_id'];
$poolId = $param['pool_id'];
$userId = $param['user_id'];
$structureId = $param['structure_id'];
# 是否是超级管理员
@ -759,17 +761,17 @@ class CustomerPoolLogic extends Common
$data = db('crm_customer_pool')->field(['admin_user_ids', 'user_ids', 'department_ids'])->where('pool_id', $poolId)->find();
# 管理员、成员、部门
$adminUserIds = !empty($data['admin_user_ids']) ? explode(',', trim($data['admin_user_ids'], ',')) : [];
$userIds = !empty($data['user_ids']) ? explode(',', trim($data['user_ids'], ',')) : [];
$structureIds = !empty($data['department_ids']) ? explode(',', trim($data['department_ids'], ',')) : [];
$adminUserIds = !empty($data['admin_user_ids']) ? explode(',', trim($data['admin_user_ids'], ',')) : [];
$userIds = !empty($data['user_ids']) ? explode(',', trim($data['user_ids'], ',')) : [];
$structureIds = !empty($data['department_ids']) ? explode(',', trim($data['department_ids'], ',')) : [];
# 权限判断
$authority['index'] = ($userLevel || in_array($userId, $adminUserIds)) || (in_array($userId, $userIds) || in_array($structureId, $structureIds));
$authority['receive'] = ($userLevel || in_array($userId, $adminUserIds)) || (in_array($userId, $userIds) || in_array($structureId, $structureIds));
$authority['distribute'] = $userLevel || in_array($userId, $adminUserIds);
$authority['index'] = ($userLevel || in_array($userId, $adminUserIds)) || (in_array($userId, $userIds) || in_array($structureId, $structureIds));
$authority['receive'] = ($userLevel || in_array($userId, $adminUserIds)) || (in_array($userId, $userIds) || in_array($structureId, $structureIds));
$authority['distribute'] = $userLevel || in_array($userId, $adminUserIds);
$authority['excelexport'] = $userLevel || in_array($userId, $adminUserIds);
$authority['excelimport'] = $userLevel || in_array($userId, $adminUserIds);
$authority['delete'] = $userLevel || in_array($userId, $adminUserIds);
$authority['delete'] = $userLevel || in_array($userId, $adminUserIds);
return $authority;
}
@ -778,9 +780,9 @@ class CustomerPoolLogic extends Common
* 获取用户公海字段样式
*
* @param array $param pool 公海IDuser_is 用户ID
* @author fanqi
* @since 2021-04-22
* @return array[]
* @since 2021-04-22
* @author fanqi
*/
public function getFieldConfigIndex($param)
{
@ -789,12 +791,12 @@ class CustomerPoolLogic extends Common
# 公海字段-用户配置数据
$data = db('crm_customer_pool_field_style')->where(['pool_id' => $param['pool_id'], 'user_id' => $param['user_id']])->value('content');
$data = !empty($data) ? json_decode($data, true) :[];
$data = !empty($data) ? json_decode($data, true) : [];
if (!empty($data)) {
$exceptFields = db('admin_field')->where(['types' => 'crm_customer', 'form_type' => ['in', ['file', 'handwriting_sign', 'desc_text', 'detail_table']]])->column('field');
foreach ($data AS $key => $value) {
foreach ($data as $key => $value) {
if (in_array($value['field'], $exceptFields)) continue;
if (!empty($value['is_hidden'])) {
@ -806,12 +808,12 @@ class CustomerPoolLogic extends Common
} else {
# 公海字段-后台配置数据
$where = [
'pool_id' => $param['pool_id'],
'pool_id' => $param['pool_id'],
'is_hidden' => 0,
'form_type' => ['notin', ['file', 'handwriting_sign', 'desc_text', 'detail_table']]
];
$poolField = db('crm_customer_pool_field_setting')->where($where)->select();
foreach ($poolField AS $key => $value) {
foreach ($poolField as $key => $value) {
if (empty($value['is_hidden'])) {
$showList[] = [
'field' => $value['field_name'],
@ -837,10 +839,10 @@ class CustomerPoolLogic extends Common
public function setFieldWidth($param)
{
$data = db('crm_customer_pool_field_style')->where(['pool_id' => $param['pool_id'], 'user_id' => $param['user_id']])->value('content');
$data = !empty($data) ? json_decode($data, true) :[];
$data = !empty($data) ? json_decode($data, true) : [];
if (!empty($data)) {
foreach ($data AS $key => $value) {
foreach ($data as $key => $value) {
if ($param['field'] == $value['field']) {
$data[$key]['width'] = $param['width'];
}
@ -852,7 +854,7 @@ class CustomerPoolLogic extends Common
} else {
$result = [];
$poolField = db('crm_customer_pool_field_setting')->where('pool_id', $param['pool_id'])->select();
foreach ($poolField AS $key => $value) {
foreach ($poolField as $key => $value) {
if ($param['field'] == $value['field_name']) {
$value['width'] = $param['width'];
}
@ -884,11 +886,11 @@ class CustomerPoolLogic extends Common
*/
public function setFieldConfig($param)
{
$data = [];
$data = [];
$showList = $param['value'];
$hideList = $param['hide_value'];
foreach ($showList AS $key => $value) {
foreach ($showList as $key => $value) {
$data[] = [
'field' => $value['field'],
'name' => $value['name'],
@ -896,7 +898,7 @@ class CustomerPoolLogic extends Common
'width' => $value['width']
];
}
foreach ($hideList AS $key => $value) {
foreach ($hideList as $key => $value) {
$data[] = [
'field' => $value['field'],
'name' => $value['name'],
@ -926,9 +928,9 @@ class CustomerPoolLogic extends Common
*
* @param string $source 源ids
* @param array $target 目标数组
* @author fanqi
* @since 2021-04-14
* @return string
* @since 2021-04-14
* @author fanqi
*/
private function fieldTransformToText($source, $target)
{
@ -936,7 +938,7 @@ class CustomerPoolLogic extends Common
$array = explode(',', trim($source, ','));
foreach ($array AS $kk => $vv) {
foreach ($array as $kk => $vv) {
if (!empty($target[$vv])) $result[] = $target[$vv];
}
@ -947,14 +949,14 @@ class CustomerPoolLogic extends Common
* 查询表字段
*
* @param int $poolId 公海ID
* @author fanqi
* @since 2021-04-14
* @return string
* @since 2021-04-14
* @author fanqi
*/
private function getPoolQueryField($poolId)
{
# 自定义字段
$customerFields = db('crm_customer_pool_field_setting')->where('pool_id', $poolId)->where('is_hidden',0)->column('field_name');
$customerFields = db('crm_customer_pool_field_setting')->where('pool_id', $poolId)->where('is_hidden', 0)->column('field_name');
$customerFields[] = 'customer_id';
# 自定增加表别名
@ -968,9 +970,9 @@ class CustomerPoolLogic extends Common
/**
* 获取员工列表
*
* @author fanqi
* @since 2021-04-14
* @return array
* @since 2021-04-14
* @author fanqi
*/
private function getUserList()
{
@ -978,7 +980,7 @@ class CustomerPoolLogic extends Common
$list = db('admin_user')->field(['id', 'realname'])->select();
foreach ($list AS $key => $value) {
foreach ($list as $key => $value) {
$result[$value['id']] = $value['realname'];
}
@ -988,9 +990,9 @@ class CustomerPoolLogic extends Common
/**
* 获取部门列表
*
* @author fanqi
* @since 2021-04-14
* @return array
* @since 2021-04-14
* @author fanqi
*/
private function getStructureList()
{
@ -998,7 +1000,7 @@ class CustomerPoolLogic extends Common
$list = db('admin_structure')->field(['id', 'name'])->select();
foreach ($list AS $key => $value) {
foreach ($list as $key => $value) {
$result[$value['id']] = $value['name'];
}
@ -1009,9 +1011,9 @@ class CustomerPoolLogic extends Common
* 获取客户列表
*
* @param array $customerId 客户ID
* @author fanqi
* @since 2021-04-15
* @return array
* @since 2021-04-15
* @author fanqi
*/
private function getCustomerList($customerId)
{
@ -1021,7 +1023,7 @@ class CustomerPoolLogic extends Common
$customerList = db('crm_customer')->field(['customer_id', 'owner_user_id', 'name', 'into_pool_time', 'before_owner_user_id'])->whereIn('customer_id', $customerId)->select();
# 整理客户数据
foreach ($customerList AS $key => $value) {
foreach ($customerList as $key => $value) {
$result[$value['customer_id']] = $value;
}
@ -1050,16 +1052,16 @@ class CustomerPoolLogic extends Common
$list = json_decode($list, true);
foreach ($list AS $key => $value) {
foreach ($list as $key => $value) {
if (!empty($value['is_hidden']) || empty($data[$value['field']])) continue;
$result[] = [
'field' => $value['field'],
'field' => $value['field'],
'fieldName' => $data[$value['field']]['fieldName'],
'name' => $value['name'],
'width' => $value['width'],
'name' => $value['name'],
'width' => $value['width'],
'is_hidden' => 0,
'system' => $data[$value['field']]['system'],
'system' => $data[$value['field']]['system'],
'form_type' => $data[$value['field']]['form_type'],
];
}
@ -1086,12 +1088,12 @@ class CustomerPoolLogic extends Common
# 公海字段-后台配置数据
$poolField = db('crm_customer_pool_field_setting')->where('pool_id', $param['pool_id'])->select();
$poolData = [];
foreach ($poolField AS $key => $value) {
foreach ($poolField as $key => $value) {
$poolData[$value['field_name']] = $value;
}
# 去掉隐藏的字段 + 去掉已经存在的字段 = 剩下的就是新增(隐藏后又开启)的字段
foreach ($fieldStyleList AS $key => $value) {
foreach ($fieldStyleList as $key => $value) {
# 去掉隐藏的字段
if (empty($poolData[$value['field']]) || (!empty($poolData[$value['field']]) && !empty($poolData[$value['field']]['is_hidden']))) {
unset($fieldStyleList[$key]);
@ -1108,7 +1110,7 @@ class CustomerPoolLogic extends Common
# 新增(隐藏后又开启)字段
if (!empty($poolData)) {
foreach ($poolData AS $key => $value) {
foreach ($poolData as $key => $value) {
if (empty($value['is_hidden'])) {
$fieldStyleList[] = [
'field' => $value['field_name'],
@ -1127,4 +1129,64 @@ class CustomerPoolLogic extends Common
}
}
}
/**
* 发起捞起客户审批
* @param array $param user_id 领取人IDcustomer_id 要领取的客户ID check_user_id 审核人id
*/
public function customerReceiveExamine($param)
{
$customerCheckModel = model('CustomerCheck');
$examineStepModel = new \app\admin\model\ExamineStep();
$examineStatus = $param['examineStatus'] ?? 1; // 审批是否停用
$param['check_user_id'] =1 ;// 临时测试需删除
unset($param['examineStatus']);
$dataInfo = db('crm_customer_check')->where('customer_id', 'in', $param['customer_id'])->find();
if ($dataInfo) {
return '客户已被领取待审批,请联系管理员';
}
if (($examineStatus != false && $examineStatus != 'false') || $examineStatus == 1) {
// 审核判断(是否有符合条件的审批流)
$examineFlowModel = new \app\admin\model\ExamineFlow();
if (!$examineFlowModel->checkExamine($param['user_id'], 'crm_customer_check')) {
return '暂无审批人,无法创建';
}
//添加审批相关信息
$examineFlowData = $examineFlowModel->getFlowByTypes($param['user_id'], 'crm_customer_check');
if (!$examineFlowData) {
return '无可用审批流,请联系管理员';
}
$param['flow_id'] = $examineFlowData['flow_id'];
//获取审批人信息
if ($examineFlowData['config'] == 1) {
//固定审批流
$nextStepData = $examineStepModel->nextStepUser($param['user_id'], $examineFlowData['flow_id'], 'crm_customer_check', 0, 0, 0);
$next_user_ids = arrayToString($nextStepData['next_user_ids']) ?: '';
$check_user_id = $next_user_ids ?: [];
$param['order_id'] = 1;
} else {
$check_user_id = $param['check_user_id'] ? ',' . $param['check_user_id'] . ',' : '';
}
if (!$check_user_id) {
return '无可用审批人,请联系管理员';
}
$param['check_user_id'] = is_array($check_user_id) ? ',' . implode(',', $check_user_id) . ',' : $check_user_id;
} else {
# 审批流停用,将状态改为审核通过
// $param['check_status'] = 2;
# 审批流停用,将状态改为正常 zjf 20210727 默认值为7
$param['check_status'] = 7;
}
if ($customerCheckModel->createData($param)) {
return '添加成功';
} else {
return $customerCheckModel->getError();
}
}
}

@ -186,6 +186,24 @@ class MessageLogic extends Common
return $data;
}
/**
*待审核客户捞取
*
* @author alvin guogaobo
* @version 1.0 版本号
* @since 2021/5/26 0026 13:35
*/
public function checkCustomerCheck($param){
$type = !empty($param['type']) ? $param['type'] : 1;
$isSub = 4;
unset($param['type']);
$customerCheckModel = model('CustomerCheck');
$request = $this->whereCheck($param, $type,$isSub);
$request['isMessage'] = true;
$data = $customerCheckModel->getDataList($request);
return $data;
}
/**
* 审批查询条件
* @param $param
@ -251,12 +269,25 @@ class MessageLogic extends Common
# 要提醒的商机ID
$businessIdArray = db('crm_dealt_relation')->where(['types' => ['eq', 'crm_business'], 'user_id' => ['eq', $param['user_id']]])->column('types_id');
$param['businessIdArray'] = !empty($businessIdArray) ? $businessIdArray : -1;
$param['dealt'] = 1;
break;
case '2' :
# 全部
$param['flow_user_id'] = ['like', '%,'. $param['user_id'] .',%'];
$param['dealt'] = 1;
break;
}
}elseif($isSub==4){
switch ($type) {
case '1' :
# 待审核、审核中
$param['check_status'] = ['lt', 2];
$param['check_user_id'] = ['like', '%,'. $param['user_id'] .',%'];
# 要提醒的商机ID
$businessIdArray = db('crm_dealt_relation')->where(['types' => ['eq', 'crm_customer_check'], 'user_id' => ['eq', $param['user_id']]])->column('types_id');
$param['businessIdArray'] = !empty($businessIdArray) ? $businessIdArray : -1;
break;
case '2' :
# 全部
$param['flow_user_id'] = ['like', '%,'. $param['user_id'] .',%'];
break;
}
}

@ -49,6 +49,7 @@ class Business extends Common
$businessTypeId = $request['typesId']; // 针对mobile
$businessStatusId = $request['statusId']; // 针对mobile
$overdue = $request['overdue']; // 待办事项下需联系商机(逾期)
$businessIdArray = $request['businessIdArray']; // 待办事项提醒参数
$isMessage = !empty($request['isMessage']);
unset($request['scene_id']);
unset($request['search']);
@ -62,6 +63,7 @@ class Business extends Common
unset($request['statusId']);
unset($request['overdue']);
unset($request['isMessage']);
unset($request['businessIdArray']);
$request = $this->fmtRequest($request);
$requestMap = $request['map'] ?: [];
$sceneModel = new \app\admin\model\Scene();
@ -182,7 +184,9 @@ class Business extends Common
$map['is_end'] = abs($businessStatusId);
}
}
# 待办事项查询参数
$dealtWhere = [];
if (!empty($businessIdArray)) $dealtWhere['business.business_id'] = ['in', $businessIdArray];
// 待办事项下需联系商机(逾期)
$overdueWhere = '';
if (!empty($overdue)) {
@ -195,7 +199,7 @@ class Business extends Common
$dataCount = db('crm_business')
->alias('business')
->join('__CRM_CUSTOMER__ customer', 'business.customer_id = customer.customer_id', 'LEFT')
->where($map)->where($partMap)->where($authMap)->where($overdueWhere)->count('business_id');
->where($map)->where($partMap)->where($authMap)->where($overdueWhere)->where($dealtWhere)->count('business_id');
if (!empty($getCount) && $getCount == 1) {
$data['dataCount'] = !empty($dataCount) ? $dataCount : 0;
# 商机总金额
@ -204,6 +208,7 @@ class Business extends Common
$data['extraData']['money'] = ['businessSumMoney' => !empty($sumMoney) ? sprintf("%.2f", $sumMoney) : 0.00];
return $data;
}
$list = db('crm_business')
->alias('business')
->join('__CRM_CUSTOMER__ customer', 'business.customer_id = customer.customer_id', 'LEFT')
@ -211,6 +216,7 @@ class Business extends Common
->where($partMap)
->where($authMap)
->where($overdueWhere)
->where($dealtWhere)
->limit($request['offset'], $request['length'])
->field('business.*,customer.name as customer_name')
->orderRaw($order)

@ -0,0 +1,164 @@
<?php
namespace app\crm\model;
use app\admin\model\Common;
use app\admin\model\Message;
use app\admin\traits\FieldVerificationTrait;
use think\Db;
class CustomerCheck extends Common
{
use FieldVerificationTrait;
/**
* 为了数据库的整洁同时又不影响Model和Controller的名称
* 我们约定每个模块的数据表都加上相同的前缀比如CRM模块用crm作为数据表前缀
*/
protected $name = 'crm_customer_check';
protected $createTime = 'create_time';
protected $updateTime = 'update_time';
protected $autoWriteTimestamp = true;
/**
* 待审核客户列表
* @param $request
* @return
*/
public function getDataList($request)
{
$userModel = new \app\admin\model\User();
$fieldModel = new \app\admin\model\Field();
$customer_check_id= $request['customer_check_id'];
$order_field = $request['order_field'];
$order_type = $request['order_type'];
$getCount = $request['getCount'];
$customerCheckIdArray = $request['customerCheckIdArray']; // 待办事项提醒参数
unset($request['scene_id']);
unset($request['search']);
unset($request['user_id']);
unset($request['$customer_check_id']);
unset($request['order_field']);
unset($request['order_type']);
unset($request['is_excel']);
unset($request['getCount']);
unset($request['typesId']);
unset($request['statusId']);
unset($request['overdue']);
unset($request['isMessage']);
unset($request['customerCheckIdArray']);
$request = $this->fmtRequest($request);
$requestMap = $request['map'] ?: [];
# getCount是代办事项传来的参数代办事项不需要使用场景
$sceneMap = [];
$partMap = [];
$teamMap = $requestMap['team_id'];
//团队成员 高级筛选
if ($teamMap) {
$partMap = advancedQueryFormatForTeam($teamMap, 'customer_check', '');
unset($requestMap['team_id']);
$map = $requestMap ? array_merge($sceneMap, $requestMap) : $sceneMap;
} else {
$map = $requestMap ? array_merge($sceneMap, $requestMap) : $sceneMap;
}
//排序
if ($order_type && $order_field) {
$order = $fieldModel->getOrderByFormtype('crm_customer_check', 'customer_check', $order_field, $order_type);
} else {
$order = 'customer_check.update_time desc';
}
# 待办事项查询参数
$dealtWhere = [];
if (!empty($customerCheckIdArray)) $dealtWhere['customer_check.customer_check_id'] = ['in', $customerCheckIdArray];
$dataCount = db('crm_customer_check')
->alias('customer_check')
->join('__CRM_CUSTOMER__ customer', 'customer_check.customer_check_id = customer.customer_id', 'LEFT')
->where($map)->where($partMap)->where($dealtWhere)->count('customer_check_id');
if (!empty($getCount) && $getCount == 1) {
$data['dataCount'] = !empty($dataCount) ? $dataCount : 0;
return $data;
}
$list = db('crm_customer_check')
->alias('customer_check')
->join('__CRM_CUSTOMER__ customer', 'business.customer_id = customer.customer_id', 'LEFT')
->where($map)
->where($partMap)
->where($dealtWhere)
->limit($request['offset'], $request['length'])
->field('customer_check.*,customer.name as customer_name')
->orderRaw($order)
->select();
# 扩展数据
$extraData = [];
$data = [];
$data['list'] = $list ?: [];
$data['dataCount'] = $dataCount ?: 0;
return $data;
}
/**
* 创建客户捞取审批信息
* @param
* @return
*/
public function createData($param)
{
$createData = [];
foreach ($param['customer_id'] as $key => $value) {
$createData[$key]['customer_id'] = $value;
$createData[$key]['check_status'] = $param['check_status'] ?? 0;
$createData[$key]['flow_id'] = $param['flow_id'] ?? 0;
$createData[$key]['order_id'] = $param['order_id'] ?? 0;
$createData[$key]['check_user_id'] = $param['check_user_id'] ?? 0;
$createData[$key]['flow_user_id'] = $param['flow_user_id'] ?? 0;
$createData[$key]['user_id'] = $param['user_id'] ?? 0;
}
$this->startTrans();
try {
$data = $this->saveAll($createData);
$this->commit();
} catch (\Exception $e) {
$this->error = '领取失败';
$this->rollback();
return false;
}
foreach ($data as $k => $v) {
//站内信
$send_user_id = stringToArray($param['check_user_id']);
if ($send_user_id && empty($param['check_status'])) {
(new Message())->send(
Message::CUSTOMER_CHECK_TO_DO,
[
'title' => $param['name'],
'action_id' => $v['customer_check_id']
],
$send_user_id
);
}
$data = [];
$data['customer_check_id'] = $v['customer_check_id'];
echo $v['customer_check_id'];
# 创建待办事项的关联数据
$checkUserIds = db('crm_customer_check')->where('customer_check_id', $data['customer_check_id'])->value('check_user_id');
$checkUserIdArray = stringToArray($checkUserIds);
$dealtData = [];
foreach ($checkUserIdArray as $kk => $vv) {
$dealtData[] = [
'types' => 'crm_customer_check',
'types_id' => $data['customer_check_id'],
'user_id' => $vv
];
}
if (!empty($dealtData)) db('crm_dealt_relation')->insertAll($dealtData);
}
}
}

@ -470,6 +470,30 @@ class ExamineLogic extends Common
->where($where)
->where($whereOr)
->count();
case 5:// 客户
$list = db('crm_customer_check')
->alias('a')
->join('__ADMIN_USER__ user', 'user.id = a.user_id', 'LEFT')
->join('__ADMIN_EXAMINE_FLOW__ examine_flow', 'examine_flow.flow_id = a.flow_id', 'LEFT')
->join('__CRM_CUSTOMER__ customer','customer.customer_id=a.customer_id','LEFT')
->where($where)
->where($whereOr)
->field(
'a.customer_check_id as catagory_id ,customer.name as customer_name,a.create_time,a.check_status,a.create_user_id,a.check_user_id,a.flow_user_id,user.realname,examine_flow.name as examine_name'
)
->page($param['page'], $param['limit'])
->order('a.create_time desc')
->select();
foreach ($list as $k => $v) {
$list[$k]['create_user_info'] = $userModel->getUserById($v['create_user_id']);
}
$dataCount = db('crm_customer_check')
->alias('a')
->join('__ADMIN_USER__ user', 'user.id = a.user_id', 'LEFT')
->where($where)
->where($whereOr)
->count();
}

@ -71,6 +71,8 @@ return [
'crm/customerPool/authority' => ['crm/customerPool/authority', ['method' => 'POST']],
// 【客户】领取公海客户
'crm/customerPool/receive' => ['crm/customerPool/receive', ['method' => 'POST']],
// 【客户】领取公海客户审批
'crm/customerPool/checkCustomerReveive' => ['crm/customerPool/checkCustomerReveive', ['method' => 'POST']],
// 【客户】分配公海客户
'crm/customerPool/distribute' => ['crm/customerPool/distribute', ['method' => 'POST']],
// 【客户】删除公海客户
@ -409,6 +411,7 @@ return [
'crm/message/remindCustomer' => ['crm/message/remindCustomer', ['method' => 'POST']],
'crm/message/checkInvoice' => ['crm/message/checkInvoice', ['method' => 'POST']],
'crm/message/checkBusiness' => ['crm/message/checkBusiness', ['method' => 'POST']],
'crm/message/checkCustomerCheck' => ['crm/message/checkCustomerCheck', ['method' => 'POST']],
'crm/message/newBusiness' => ['crm/message/newBusiness', ['method' => 'POST']],
'crm/message/visitContract' => ['crm/message/visitContract', ['method' => 'POST']],
'crm/message/allDeal' => ['crm/message/allDeal', ['method' => 'POST']],

Loading…
Cancel
Save