pull/9/head
张萌 2 years ago
parent 9de3b06f53
commit c33c0f45c3

@ -251,12 +251,10 @@ 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;
}
}

@ -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)

Loading…
Cancel
Save