Merge pull request '销售漏斗' (#30) from zm into master

Reviewed-on: mengfucius/wkcrm#30
pull/40/head
张萌 2 years ago
commit c57233837d

@ -219,6 +219,16 @@ class Index extends ApiCommon
$param['end_time'] = $param['end_time'] . ' 23:59:59'; $param['end_time'] = $param['end_time'] . ' 23:59:59';
} }
$list = $businessModel->getFunnel($param); $list = $businessModel->getFunnel($param);
$list['list'][] = [
"name" => "赢单",
"status_id" => "10000",
"status_name" => "赢单",
];
$list['list'][] = [
"name" => "输单",
"status_id" => "10001",
"status_name" => "输单",
];
return resultArray(['data' => $list]); return resultArray(['data' => $list]);
} }
@ -702,7 +712,11 @@ class Index extends ApiCommon
$userInfo = $this->userInfo; $userInfo = $this->userInfo;
$param['user_id'] = $param['user_id'] ?: $userInfo['id']; $param['user_id'] = $param['user_id'] ?: $userInfo['id'];
$indexModel = new IndexLogic; $indexModel = new IndexLogic;
if ($param['status_id'] == "10000" || $param['status_id'] == "10001") {
$data['funnel'] = $param['status_id'];
}
$data = $indexModel->businessList($param); $data = $indexModel->businessList($param);
return resultArray(['data' => $data]); return resultArray(['data' => $data]);
} }
@ -754,7 +768,8 @@ class Index extends ApiCommon
* 跟进详情 * 跟进详情
* @return \think\response\Json * @return \think\response\Json
*/ */
public function activityList(){ public function activityList()
{
$param = $this->param; $param = $this->param;
$userInfo = $this->userInfo; $userInfo = $this->userInfo;
$param['id'] = $userInfo['id']; $param['id'] = $userInfo['id'];

@ -52,6 +52,7 @@ class Business extends Common
$overdue = $request['overdue']; // 待办事项下需联系商机(逾期) $overdue = $request['overdue']; // 待办事项下需联系商机(逾期)
$businessIdArray = $request['businessIdArray']; // 待办事项提醒参数 $businessIdArray = $request['businessIdArray']; // 待办事项提醒参数
$isMessage = !empty($request['isMessage']); $isMessage = !empty($request['isMessage']);
$funnelQuery = $request['funnel']; // 销售漏斗查询赢单输单
unset($request['scene_id']); unset($request['scene_id']);
unset($request['search']); unset($request['search']);
unset($request['user_id']); unset($request['user_id']);
@ -142,6 +143,18 @@ class Business extends Common
}; };
} }
} }
// 销售漏斗处理
if (!empty($funnelQuery)){
unset($map['business.status_id']);
unset($map['business.is_end']);
switch ($funnelQuery){
case '10000':// 赢单
$map['business.is_end']=1;
case "10001":// 输单
$map['business.is_end']=2;
}
}
//联系人商机 //联系人商机
if ($contacts_id) { if ($contacts_id) {

Loading…
Cancel
Save