Compare commits

..

No commits in common. '707e4ee948bfccb6a11110ae5c927d603fe61cbb' and 'dcd2845f6102f1287130cb7a5ecef61b7dbe1661' have entirely different histories.

@ -628,21 +628,6 @@ class Business extends ApiCommon
'customer_ids' => ',' . $businessInfo['customer_id'] . ','
]);
# 删除待办事项的关联数据
db('crm_dealt_relation')->where(['types' => ['eq', 'crm_business'], 'types_id' => ['eq', $data['business_id']]])->delete();
# 创建待办事项的关联数据
$checkUserIds = db('crm_business')->where('business_id', $data['business_id'])->value('check_user_id');
$checkUserIdArray = stringToArray($checkUserIds);
$dealtData = [];
foreach ($checkUserIdArray AS $kk => $vv) {
$dealtData[] = [
'types' => 'crm_business',
'types_id' => $data['business_id'],
'user_id' => $vv
];
}
if (!empty($dealtData)) db('crm_dealt_relation')->insertAll($dealtData);
//推进记录添加
$temp['status_id'] = $status_id ?: 0;
$temp['is_end'] = $businessInfo['is_end'] ?: 0;

@ -735,7 +735,7 @@ class Message extends ApiCommon
}
# 处理待审核合同、回款、发票
if (in_array($type, ['checkContract', 'checkReceivables', 'checkInvoice','checkBusiness'])) {
if (in_array($type, ['checkContract', 'checkReceivables', 'checkInvoice'])) {
$where['check_status'] = ['lt', '2'];
$where['check_user_id'] = ['like', ',%' . $userId . '%,'];
@ -754,11 +754,6 @@ class Message extends ApiCommon
$invoiceId = !empty($typeId) ? $typeId : Db::name('crm_invoice')->where($where)->column('invoice_id');
db('crm_dealt_relation')->where('user_id', $userId)->where('types', 'crm_invoice')->whereIn('types_id', $invoiceId)->delete();
}
# 商机
if ($type == 'checkBusiness') {
$invoiceId = !empty($typeId) ? $typeId : Db::name('crm_business')->where($where)->column('business_id');
db('crm_dealt_relation')->where('user_id', $userId)->where('types', 'crm_business')->whereIn('types_id', $invoiceId)->delete();
}
}

@ -177,7 +177,7 @@ class MessageLogic extends Common
*/
public function checkBusiness($param){
$type = !empty($param['type']) ? $param['type'] : 1;
$isSub = 3;
$isSub = 1;
unset($param['type']);
$businessModel = model('Business');
$request = $this->whereCheck($param, $type,$isSub);
@ -242,23 +242,6 @@ class MessageLogic extends Common
$param['dealt'] = 1;
break;
}
}elseif($isSub==3){
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_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;
}
}
return $param;
}

Loading…
Cancel
Save