dyb #5

Merged
mengfucius merged 3 commits from dyb into master 2 years ago

@ -1250,9 +1250,11 @@ class Field extends Model
// $new_field_list[] = db('admin_field')->where(['types_id' => 0, 'field' => 'owner_user_id'])->find();
// }
if ($new_field_list) $field_list = array_merge(collection($field_list)->toArray(), $new_field_list);
$adminTypes = adminGroupTypes($user_id);
foreach ($field_list as $k => $v) {
# 处理字段授权
$field_list[$k]['writeStatus'] = 1;
if($field_list[$k]['name'] == '客户级别' && !in_array(1,$adminTypes)) $field_list[$k]['writeStatus'] = 0;
if (!$userLevel && $param['module'] == 'crm' && !empty($grantData[$param['types']])) {
$status = getFieldGrantStatus($v['field'], $grantData[$param['types']]);

@ -91,7 +91,7 @@ class Message extends ApiCommon
$todayLeads = $this->todayLeads(true);
$data['todayLeads'] = $todayLeads['dataCount'] ? : 0;
cache('todayLeadsCount'.$userInfo['id'], $data['todayLeads']);
cache('todayLeadsTime'.$userInfo['id'], time() + 180);
cache('todayLeadsTime'.$userInfo['id'], time() );
}
# 今日需联系客户
$todayCustomerTime = cache('todayCustomerTime'.$userInfo['id']);
@ -102,7 +102,7 @@ class Message extends ApiCommon
$todayCustomer = $this->todayCustomer(true);
$data['todayCustomer'] = $todayCustomer['dataCount'] ? : 0;
cache('todayCustomerCount'.$userInfo['id'], $data['todayCustomer']);
cache('todayCustomerTime'.$userInfo['id'], time() + 180);
cache('todayCustomerTime'.$userInfo['id'], time() );
}
# 今日需联系商机
$todayBusinessTime = cache('todayBusinessTime'.$userInfo['id']);
@ -113,7 +113,7 @@ class Message extends ApiCommon
$todayBusiness = $this->todayBusiness(true);
$data['todayBusiness'] = $todayBusiness['dataCount'] ? : 0;
cache('todayBusinessCount'.$userInfo['id'], $data['todayBusiness']);
cache('todayBusinessTime'.$userInfo['id'], time() + 180);
cache('todayBusinessTime'.$userInfo['id'], time() );
}
# 分配给我的线索
$followLeadsTime = cache('followLeadsTime'.$userInfo['id']);
@ -124,7 +124,7 @@ class Message extends ApiCommon
$followLeads = $this->followLeads(true);
$data['followLeads'] = $followLeads['dataCount'] ? : 0;
cache('followLeadsCount'.$userInfo['id'], $data['followLeads']);
cache('followLeadsTime'.$userInfo['id'], time() + 180);
cache('followLeadsTime'.$userInfo['id'], time() );
}
# 分配给我的客户
$followCustomerTime = cache('followCustomerTime'.$userInfo['id']);
@ -135,7 +135,7 @@ class Message extends ApiCommon
$followCustomer = $this->followCustomer(true);
$data['followCustomer'] = $followCustomer['dataCount'] ? : 0;
cache('followCustomerCount'.$userInfo['id'], $data['followCustomer']);
cache('followCustomerTime'.$userInfo['id'], time() + 180);
cache('followCustomerTime'.$userInfo['id'], time() );
}
# 待审核合同
$checkContractTime = cache('checkContractTime'.$userInfo['id']);
@ -146,7 +146,7 @@ class Message extends ApiCommon
$checkContract = $this->checkContract(true);
$data['checkContract'] = $checkContract['dataCount'] ? : 0;
cache('checkContractCount'.$userInfo['id'], $data['checkContract']);
cache('checkContractTime'.$userInfo['id'], time() + 180);
cache('checkContractTime'.$userInfo['id'], time() );
}
# 待审核回款
$checkReceivablesTime = cache('checkReceivablesTime'.$userInfo['id']);
@ -157,7 +157,7 @@ class Message extends ApiCommon
$checkReceivables = $this->checkReceivables(true);
$data['checkReceivables'] = $checkReceivables['dataCount'] ? : 0;
cache('checkReceivablesCount'.$userInfo['id'], $data['checkReceivables']);
cache('checkReceivablesTime'.$userInfo['id'], time() + 180);
cache('checkReceivablesTime'.$userInfo['id'], time() );
}
# 待审核发票
$checkInvoiceTime = cache('checkInvoiceTime'.$userInfo['id']);
@ -170,7 +170,7 @@ class Message extends ApiCommon
$data['checkInvoice'] = $checkInvoice['dataCount'] ? : 0;
cache('checkInvoiceCount'.$userInfo['id'], $data['checkInvoice']);
cache('checkInvoiceTime'.$userInfo['id'], time() + 180);
cache('checkInvoiceTime'.$userInfo['id'], time() );
}
# 待回款提醒
$remindReceivablesPlanTime = cache('remindReceivablesPlanTime'.$userInfo['id']);
@ -181,7 +181,7 @@ class Message extends ApiCommon
$remindReceivablesPlan = $this->remindReceivablesPlan(true);
$data['remindReceivablesPlan'] = $remindReceivablesPlan['dataCount'] ? : 0;
cache('remindReceivablesPlanCount'.$userInfo['id'], $data['remindReceivablesPlan']);
cache('remindReceivablesPlanTime'.$userInfo['id'], time() + 180);
cache('remindReceivablesPlanTime'.$userInfo['id'], time() );
}
if ($configData['visit_config'] == 1) {
# 待回访合同
@ -193,7 +193,7 @@ class Message extends ApiCommon
$visitContract = $this->visitContract(true);
$data['returnVisitRemind'] = $visitContract['dataCount'] ? : 0;
cache('visitContractCount'.$userInfo['id'], $data['returnVisitRemind']);
cache('visitContractTime'.$userInfo['id'], time() + 180);
cache('visitContractTime'.$userInfo['id'], time() );
}
}
# 即将到期合同
@ -206,7 +206,7 @@ class Message extends ApiCommon
$endContract = $this->endContract(true);
$data['endContract'] = $endContract['dataCount'] ? : 0;
cache('endContractCount'.$userInfo['id'], $data['endContract']);
cache('endContractTime'.$userInfo['id'], time() + 180);
cache('endContractTime'.$userInfo['id'], time() );
}
}
# 待进入公海提醒
@ -220,7 +220,7 @@ class Message extends ApiCommon
$remindCustomer = $this->remindCustomer(true);
$data['putInPoolRemind'] = !empty($remindCustomer['dataCount']) ? $remindCustomer['dataCount'] : 0;
cache('remindCustomerCount'.$userInfo['id'], $data['putInPoolRemind']);
cache('remindCustomerTime'.$userInfo['id'], time() + 180);
cache('remindCustomerTime'.$userInfo['id'], time() );
}
}

Loading…
Cancel
Save