kanvas/guild

Kanvas Guild 是一个客户关系管理包。

维护者

详细信息

github.com/bakaphp/guild

源代码

问题

安装次数: 1,101

依赖项: 0

建议者: 0

安全性: 0

星标: 0

关注者: 1

分支: 0

开放性问题: 0

类型:项目

0.1.x-dev 2023-01-06 16:57 UTC

This package is auto-updated.

Last update: 2024-09-06 20:27:42 UTC


README

Guild

Guild 是一个客户关系管理包,允许用户管理他的潜在客户和交易,类似于一个公会管理其成员及其任务,以及与他们相关的报告和计划。

提供管理获取潜在客户和CRM相关功能的方法。

方法

潜在客户

创建新的潜在客户

/**
 * Create a new Lead
 *
 * @param UserInterface $user
 * @param string $title
 * @param ModelsStages $pipelineStage
 * @param LeadsRotationsAgents $agent
 * @param Organizations $organization
 * @param Types $leadType
 * @param Status $leadStatus
 * @param Source $leadSource
 * @param boolean $isDuplicate
 * @param string $description
 * @return ModelsLeads
 */

    $leads = Leads::create(
        $user,
        $title,
        $modelPipelineStage,
        $leadRotationsAgent,
        $organization,
        $leadType,
        $leadStatus,
        $leadSource,
        $isDuplicate,
        $descriptions
    );

创建新的潜在客户尝试

$data = [
    'request' => 'Request Data',
    'ip' => '123.456.789',
    'header' => 'Request Header',
    'source' => 'Source',
    'public_key' => 'Key',
    'processed' => 0,
]

/**
 * Create a new lead attempt
 *
 * @param UserInterface $user
 * @param array $data
 * @param Leads|null $lead
 * @return ModelAttempts
 */
Leads::attempt($user, $data, $lead);

更新

// find a lead by id

$lead = Leads::getById(4, $user);
$lead->Title = 'new Title';
$lead->saveOrFail();

获取潜在客户

//Get all the leads
$page = 1;
$limit = 10;
$leads = Leads::getAll($user, $page, $limit);

//Get Leads by id
$leads = Leads::getById(4);

//Get leads by status
$leads = Leads::getByStatus(LeadStatus::LOSE, $user, $page, $limit);
$leads = Leads::getByStatus(LeadStatus::WIN, $user, $page, $limit);

组织

创建

//Create a new organization by an array of data
$organization = Organization::create($data, $user);

更新

$organization = Organization::getById(3, $user);
Organization::update($organization, $data);

或者

$organization = Organization::getById(3)->update($data);

获取

//Get Organization by its id
$organization = Organization::getById(3, $user);

//Get All organization
$page = 1;
$limit = 10;
$organization = Organization::getAll($user, $page, $limit);

将人员添加到组织中

//Get the people and the organization
$people = Peoples::getById(3);
$organization = Organization::getById(3, $user);

// Add a new people to an organization
Organization::addPeople($organization, $people);

或者

$organization = Organization::getById(3);
$organization->addPeople($people);

从组织中获取人员

$organization = Organization::getById(3);
$organization->getPeoples();

人员

创建

$data = [
    'name' => 'Romeo',
    'email' => 'Romeo@mail.com'
];

$people = People::create($data, $user)

更新

$people = People::getById(1, $user);

$people->name = 'New juan';
$people->saveOrFail();

或者

$people = People::getById(1, $user)->update($data);

创建联系

// @people People user data for the new contact
// @contactType
Contacts::createNewContact($people, $contactType, $value);

更新联系

交易

创建

$lead = Lead::getById(1, $user);
$newDeal = Deal::create($user, $lead)

通过潜在客户获取

$lead = Lead::getById(1, $user);
$deal = $lead->getDeal();

获取

$deal = Deal::getById(2, $user); 
$page = 1;
$limit = 10;
$deal = Deal::getAll($user, $page, $limit);

更新

Deal::update(Deal::getById(2), $data);

管道

创建

$pipelines = Pipelines::create($name, $entity, $user);

获取

$page = 1;
$limit = 10;
$pipelines = Pipelines::getAll($user, $page, $limit);

或者

$pipeline = Pipelines::getById($name);

更新

$pipeline = Pipelines::getById(1);
Pipelines::update($pipeline, $name);

创建阶段

// $pipeline Pipeline Object
// $name string
// $hasRotting boolean
// $rottingDays int
Pipelines::createStage($pipeline, $name, $hasRotting, $rottingDays);

获取阶段

$pipelineStage = Pipelines::getStageById(1);

或者

$pipelineStage = Pipelines::getStagesByPipeline($pipeline);

更新阶段

$pipelineStage = Pipelines::getStageById(1);
Pipelines::updateStage($pipelineStage, $data)

轮换

创建

$pipelines = Rotations::create($name, $user);

更新

$rotation = Rotations::getById(1);
Rotations::update($rotation, $name);

获取

$rotation = Rotations::getById(1, $user);

$rotation = Rotation::getByName($name, $user);

代理商

添加

Agents::create($rotation, $user, $receiver, $percent, $hits);

获取代理商

Agents::getAllAgents($rotation, $page, $limit);

Agents::getAgentsFromRotation($rotation, $page, $limit);

Agents::getAgentById(2, $user);

更新代理商

$agent = Rotation::getAgentById(2, $user);
Rotations::update($agent, $data);

获取当前代理商轮换

Rotation::getAgent($rotation);

活动

创建

$activity = Activities::create(
    $user,
    "Title",
    $startDate,
    $endDate,
    $lead,
    $activityType,
    $isComplete,
    $appId
);

创建活动类型

$type = Activities::createType($user, $name, $description);

更新

$activityEdited = Activities::update($activity, $data);

获取

// Get activity by id
Activities::getById(1, $user);

// Get all activities
Activities::getAll($user, $page, $limit);

// Get leads activities
$lead = Leads::getById(1);

$lead->getActivities();