model = new MarketCustomer(); $this->validate = true; $this->validateClass = new MarketCustomerValidate(); } /** * Notes: 获取选项配置信息 * User: yb * Date: 2024/8/5 * Time: 15:35 */ public function getOptionConfig() { return json_success('请求成功', CustomService::config()); } /** * Notes: 新增客户 * User: yb * Date: 2024/8/6 * Time: 11:19 */ public function addCustom(Request $request) { $params = $request->post(); if ($this->validate && !$this->validateClass->scene('add')->check($params)) { return json_fail($this->validateClass->getError()); } return CustomService::add($params); } /** * Notes: 编辑客户 * User: yb * Date: 2024/8/6 * Time: 16:51 */ public function updateCustom(Request $request) { $params = $request->post(); if ($this->validate && !$this->validateClass->scene('update')->check($params)) { return json_fail($this->validateClass->getError()); } return CustomService::update($params); } public function select(Request $request): Response { return CustomService::index($request); } /** * Notes: 删除客户 * User: yb * Date: 2024/8/2 * Time: 13:34 * @param Request $request * @return Response */ public function deleteCustom(Request $request) { $params = $request->post(); if (empty($params['ids'])) { return json_fail('请选择要删除的数据'); } return CustomService::delete($params['ids']); } /** * Notes: 跟进记录 * User: yb * Date: 2024/8/7 * Time: 8:59 * @param Request $request */ public function followList(Request $request) { return CustomService::follow($request); } /** * Notes: 删除跟进记录 * User: yb * Date: 2024/8/7 * Time: 11:32 * @param Request $request */ public function deleteFollow(Request $request) { $params = $request->post(); if (empty($params['ids'])) { return json_fail('请选择要删除的数据'); } return CustomService::deleteFollow($params['ids']); } /** * Notes: 转移客户 * User: yb * Date: 2024/8/7 * Time: 14:22 * @param Request $request */ public function moveCustom(Request $request) { $params = $request->post(); if (empty($params['consultant_id'])) { return json_fail('请选择目标顾问'); } if (empty($params['move_market_customer_id']) && empty($params['move_consultant_id'])) { return json_fail('请选择需要转移的客户或顾问'); } return CustomService::moveCustom($params); } /** * Notes: 转移记录 * User: yb * Date: 2024/8/7 * Time: 15:34 * @param Request $request * @return Response */ public function moveLogs(Request $request) { return CustomService::moveLogs($request); } /** * Notes: 报备审核 * User: yb * Date: 2024/8/16 * Time: 15:55 * @param Request $request */ public function checkCustom(Request $request) { $params = $request->post(); if ($this->validate && !$this->validateClass->scene('check')->check($params)) { return json_fail($this->validateClass->getError()); } return CustomService::checkCustom($params); } /** * Notes: 统计分析 * User: yb * Date: 2024/8/17 * Time: 11:50 */ public function statisticsIndex(Request $request) { return CustomService::statisticsIndex($request); } /** * Notes: 导出 * User: yb * Date: 2024/8/17 * Time: 13:29 * @param Request $request * @return Response */ public function exportData(Request $request) { return CustomService::exportData($request); } /** * Notes: 按月统计 * User: yb * Date: 2024/8/21 * Time: 15:54 */ public function statisticsByMonth() { return CustomService::statisticsMonth(); } }