all(),[ 'start_date' => 'required|date', 'end_date' => 'required|date', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $params['corpid'] = $request->input('corpid'); $params['sys_group_id'] = $request->input('sys_group_id'); $params['start_date'] = $request->input('start_date'); $params['end_date'] = $request->input('end_date'); $sortField = $request->input('sort_field', 'corpid'); $sortType = $request->input('sort_type', 'desc'); // 排序方式 $page = $request->input('page', 1); $pageSize = $request->input('page_size', 10); # 获取账号客户流失数据趋势 list($list, $count, $retrieveColumns) = CustomerLossService::getFansLossTrend( $params, $sortField, $sortType, $page, $pageSize ); return self::returnPageValue($list, $count, $pageSize, $page, $retrieveColumns); } /** * 账号客户流失总概数据 * */ public function accountLossSummary(Request $request) { $validator = \Validator::make($request->all(),[ 'start_date' => 'required|date', 'end_date' => 'required|date', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $params['corpid'] = $request->input('corpid'); $params['sys_group_id'] = $request->input('sys_group_id'); $params['start_date'] = $request->input('start_date'); $params['end_date'] = $request->input('end_date'); list($data, $header) = CustomerLossService::getFansLossSummary($params); return self::returnValue([ 'data' => $data, 'header' => $header ]); } /** * 账号客户流失趋势曲线 * */ public function accountLossCurve(Request $request) { $validator = \Validator::make($request->all(),[ 'start_date' => 'required|date', 'end_date' => 'required|date', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $params['corpid'] = $request->input('corpid'); $params['sys_group_id'] = $request->input('sys_group_id'); $params['start_date'] = $request->input('start_date'); $params['end_date'] = $request->input('end_date'); $data = CustomerLossService::getFansLossCurve($params); return self::returnValue(['data' => $data]); } }