123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- <?php
- namespace app\wechat\controller;
- use app\wechat\IndexController;
- use app\wechat\service\CustomService;
- use app\wechat\validate\CustomValidate;
- use support\Request;
- class CustomController extends IndexController
- {
- public function __construct()
- {
- $this->validateClass = new CustomValidate();
- }
- /**
- * Notes: 选项配置
- * User: yb
- * Date: 2024/8/8
- * Time: 15:08
- * @return \support\Response
- */
- public function options()
- {
- return json_success('请求成功', CustomService::config());
- }
- /**
- * Notes:新增客户
- * User: yb
- * Date: 2024/8/8
- * Time: 15:08
- */
- public function addCustom(Request $request)
- {
- $params = $request->post();
- if (!$this->validateClass->scene('add')->check($params)) {
- return json_fail($this->validateClass->getError());
- }
- return CustomService::add($params);
- }
- /**
- * Notes: 客户列表
- * User: yb
- * Date: 2024/8/12
- * Time: 10:57
- */
- public function customList(Request $request)
- {
- $params = $request->post();
- return CustomService::index($params);
- }
- /**
- * Notes: 编辑客户
- * User: yb
- * Date: 2024/8/12
- * Time: 10:36
- * @param Request $request
- */
- public function editCustom(Request $request)
- {
- $params = $request->post();
- if (!$this->validateClass->scene('update')->check($params)) {
- return json_fail($this->validateClass->getError());
- }
- return CustomService::edit($params);
- }
- /**
- * Notes: 客户详情
- * User: yb
- * Date: 2024/8/8
- * Time: 15:48
- */
- public function customInfo(Request $request)
- {
- $params = $request->post();
- if (empty($params['id'])) {
- return json_fail('客户id不能为空');
- }
- return CustomService::info($params['id']);
- }
- /**
- * Notes: 选择客户
- * User: yb
- * Date: 2024/8/13
- * Time: 15:20
- * @param Request $request
- */
- public function selectList(Request $request)
- {
- $params = $request->post();
- return CustomService::myCustomList($params);
- }
- /**
- * Notes: 更新客户状态
- * User: yb
- * Date: 2024/8/14
- * Time: 13:21
- * @param Request $request
- */
- public function updateStatus(Request $request)
- {
- $params = $request->post();
- if (!$this->validateClass->scene('status')->check($params)) {
- return json_fail($this->validateClass->getError());
- }
- return CustomService::updateStatus($params);
- }
- /**
- * Notes: 移交客户
- * User: yb
- * Date: 2024/8/15
- * Time: 14:36
- * @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/15
- * Time: 14:36
- * @param Request $request
- */
- public function moveLogs(Request $request)
- {
- $params = $request->post();
- if (empty($params['custom_id'])) {
- return json_fail('客户id不能为空');
- }
- return CustomService::moveLogs($params);
- }
- /**
- * Notes: 审核客户
- * User: yb
- * Date: 2024/8/16
- * Time: 11:38
- */
- public function checkCustom(Request $request)
- {
- $params = $request->post();
- if (!$this->validateClass->scene('check')->check($params)) {
- return json_fail($this->validateClass->getError());
- }
- return CustomService::checkCustom($params);
- }
- /**
- * Notes: 校验客户是否已经登记
- * User: yb
- * Date: 2024/8/21
- * Time: 9:37
- * @param Request $request
- */
- public function checkMobile(Request $request)
- {
- $params = $request->post();
- return CustomService::checkPhone($params);
- }
- /**
- * Notes: 指定顾问
- * User: yb
- * Date: 2024/9/5
- * Time: 12:51
- */
- public function appointConsultant(Request $request)
- {
- $params = $request->post();
- return CustomService::appoint($params);
- }
- }
|