You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
199 lines
5.6 KiB
199 lines
5.6 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Niucloud-admin 企业快速开发的多应用管理平台
|
|
// +----------------------------------------------------------------------
|
|
// | 官方网址:https://www.niucloud.com
|
|
// +----------------------------------------------------------------------
|
|
// | niucloud团队 版权所有 开源版本可自由商用
|
|
// +----------------------------------------------------------------------
|
|
// | Author: Niucloud Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\adminapi\controller\customer_resources;
|
|
|
|
use core\base\BaseAdminController;
|
|
use app\service\admin\customer_resources\CustomerResourcesService;
|
|
|
|
|
|
/**
|
|
* 客户资源控制器
|
|
* Class CustomerResources
|
|
* @package app\adminapi\controller\customer_resources
|
|
*/
|
|
class CustomerResources extends BaseAdminController
|
|
{
|
|
/**
|
|
* 获取客户资源列表
|
|
* @return \think\Response
|
|
*/
|
|
public function lists()
|
|
{
|
|
$data = $this->request->params([
|
|
["name", ""],
|
|
["age", ""],
|
|
["gender", ""],
|
|
["phone_number", ""],
|
|
['member_label', 0],
|
|
["type", "khzy"],
|
|
["created_at", []],
|
|
["updated_at", []],
|
|
]);
|
|
return success((new CustomerResourcesService())->getPage($data));
|
|
}
|
|
|
|
/**
|
|
* 客户资源详情
|
|
* @param int $id
|
|
* @return \think\Response
|
|
*/
|
|
public function info(int $id)
|
|
{
|
|
return success((new CustomerResourcesService())->getInfo($id));
|
|
}
|
|
|
|
/**
|
|
* 添加客户资源
|
|
* @return \think\Response
|
|
*/
|
|
public function add()
|
|
{
|
|
$data = $this->request->params([
|
|
["source", ""],
|
|
["source_channel", ""],
|
|
["name", ""],
|
|
["age", 0],
|
|
["gender", ""],
|
|
["phone_number", ""],
|
|
["demand", ""],
|
|
["purchasing_power", ""],
|
|
["cognitive_idea", ""],
|
|
["optional_class_time", ""],
|
|
["distance", ""],
|
|
["decision_maker", ""],
|
|
["initial_intent", null],
|
|
["campus", ""],
|
|
["status", null],
|
|
['member_label', []],
|
|
|
|
["create_year_month", date("Y-m")],
|
|
["create_date", date("Y-m-d")],
|
|
["purchase_power", ""],
|
|
["concept_awareness", ""],
|
|
["preferred_class_time", ""],
|
|
["distance_tow", ""],
|
|
["communication", ""],
|
|
["promised_visit_time", ""],
|
|
["actual_visit_time", ""],
|
|
["call_intent", "low"],
|
|
["first_visit_status", ""],
|
|
["second_visit_status", ""],
|
|
["is_closed", ""]
|
|
|
|
]);
|
|
$this->validate($data, 'app\validate\customer_resources\CustomerResources.add');
|
|
return (new CustomerResourcesService())->add($data);
|
|
}
|
|
|
|
/**
|
|
* 客户资源编辑
|
|
* @param $id 客户资源id
|
|
* @return \think\Response
|
|
*/
|
|
public function edit(int $id)
|
|
{
|
|
$data = $this->request->params([
|
|
["source", ""],
|
|
["source_channel", ""],
|
|
["name", ""],
|
|
["age", 0],
|
|
["gender", ""],
|
|
["phone_number", ""],
|
|
["demand", ""],
|
|
["purchasing_power", ""],
|
|
["cognitive_idea", ""],
|
|
["optional_class_time", ""],
|
|
["distance", ""],
|
|
["decision_maker", ""],
|
|
["initial_intent", null],
|
|
["campus", ""],
|
|
["status", null],
|
|
['member_label', []],
|
|
["create_year_month", date("Y-m")],
|
|
["create_date", date("Y-m-d")],
|
|
|
|
["purchase_power", ""],
|
|
["concept_awareness", ""],
|
|
["preferred_class_time", ""],
|
|
["distance_tow", ""],
|
|
["communication", ""],
|
|
["promised_visit_time", ""],
|
|
["actual_visit_time", ""],
|
|
["call_intent", "low"],
|
|
["first_visit_status", ""],
|
|
["second_visit_status", ""],
|
|
["is_closed", ""]
|
|
]);
|
|
$this->validate($data, 'app\validate\customer_resources\CustomerResources.edit');
|
|
|
|
return (new CustomerResourcesService())->edit($id, $data);
|
|
}
|
|
|
|
/**
|
|
* 客户资源删除
|
|
* @param $id 客户资源id
|
|
* @return \think\Response
|
|
*/
|
|
public function del(int $id)
|
|
{
|
|
(new CustomerResourcesService())->del($id);
|
|
return success('DELETE_SUCCESS');
|
|
}
|
|
|
|
|
|
public function getPersonnelAll()
|
|
{
|
|
$data = $this->request->params([
|
|
["role_id", ""],
|
|
["dept_id",""]
|
|
]);
|
|
|
|
return success((new CustomerResourcesService())->getPersonnelAll($data));
|
|
}
|
|
|
|
public function getCampusAll()
|
|
{
|
|
return success((new CustomerResourcesService())->getCampusAll());
|
|
}
|
|
|
|
public function fp_edit()
|
|
{
|
|
$data = $this->request->params([
|
|
["shared_id", ""],
|
|
["shared_by", ""],
|
|
]);
|
|
|
|
return success((new CustomerResourcesService())->fp_edit($data));
|
|
}
|
|
|
|
public function personnelAllByname()
|
|
{
|
|
$data = $this->request->params([
|
|
["name", ""]
|
|
]);
|
|
|
|
return success((new CustomerResourcesService())->personnelAllByname($data['name']));
|
|
}
|
|
|
|
public function getCoachPerson()
|
|
{
|
|
$data = $this->request->params([
|
|
["campus_id", ""]
|
|
]);
|
|
return success((new CustomerResourcesService())->getCoachPerson($data['campus_id']));
|
|
}
|
|
|
|
public function getResourceByCourse($schedule)
|
|
{
|
|
return success((new CustomerResourcesService())->getResourceByCourse($schedule));
|
|
}
|
|
}
|
|
|