123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227 |
- <?php
- namespace app\admin\controller\consultant;
- use app\admin\service\consultant\CustomService;
- use app\admin\validate\consultant\MarketCustomerValidate;
- use app\controller\Curd;
- use app\model\MarketCustomer;
- use support\Request;
- use support\Response;
- class CustomController extends Curd
- {
- public function __construct()
- {
- $this->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['move_type'])) {
- if (empty($params['consultant_id'])) {
- return json_fail('请选择目标顾问');
- }
- } else {
- if (empty($params['dept_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/9/5
- * Time: 12:51
- */
- public function appointConsultant(Request $request)
- {
- $params = $request->post();
- return CustomService::appoint($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();
- }
- /**
- * Notes: 导入客户
- * User: yb
- * Date: 2024/9/10
- * Time: 10:29
- */
- public function importCustom(Request $request)
- {
- $params = $request->post();
- return CustomService::import($params);
- }
- }
|