1、为什么我们企业会选择Flexus云服务器X实例来部署自己的CRM管理系统?
因为基于华为云Flexus X实例搭建CRM管理平台,可以从容面对企业内部瞬息万变的业务压力变化
2、华为云服务器Flexus X方案及优势:
灵活伸缩
搭配弹性伸缩服务AS及负载均衡服务ELB,可以实现基于业务负载的快速弹缩,从容应对多变的市场业务压力
数据可靠
搭配华为云数据库服务,存储电商持久化数据,使用方便,可靠性高
安全可靠
搭配WAF、DDoS等网络安全服务,实现对电商业务全方位安全防护,降低黑客入侵风险
3、在宝塔里面安装必要的环境PHP7.3、Mysql5.6+、NGINX
4、安装搭建好,进入CRM管理界面:
点击添加客户信息的时候就会发现,提示:
APP Referer校验失败。请检查该ak设置的白名单与访问所有的域名是否一致。详情查看:http://lbsyun.baidu.com/apiconsole/key#
这是由于百度地图api接口没有配置好导致的问题出现
当配置好地图参数之后,就可以进行地区定位和使用附件客户等功能了
5、客户详情功能模块代码
public function read()
{
$customerModel = model('Customer');
$cutomerLogic = new CustomerLogic();
$param = $this->param;
$userInfo = $this->userInfo;
$data = $customerModel->getDataById($param['id'], $userInfo['id']);
if (!$data) {
return resultArray(['error' => $customerModel->getError()]);
}
//数据权限判断
$userModel = new \app\admin\model\User();
$auth_user_ids = $userModel->getUserByPer('crm', 'customer', 'read');
//读权限
$roPre = $userModel->rwPre($userInfo['id'], $data['ro_user_id'], $data['rw_user_id'], 'read');
$rwPre = $userModel->rwPre($userInfo['id'], $data['ro_user_id'], $data['rw_user_id'], 'update');
//判断是否客户池数据
$wherePool = $customerModel->getWhereByPool();
$resPool = db('crm_customer')->alias('customer')->where(['customer_id' => $param['id']])->where($wherePool)->find();
if (!$resPool && !in_array($data['owner_user_id'], $auth_user_ids) && !$roPre && !$rwPre) {
$authData['dataAuth'] = (int)0;
return resultArray(['data' => $authData]);
}
return resultArray(['data' => $data]);
}
6、编辑客户功能模块代码
public function update()
{
$customerModel = model('Customer');
$param = $this->param;
$userInfo = $this->userInfo;
//数据详情
$data = $customerModel->getDataById($param['id']);
if (!$data) {
return resultArray(['error' => $customerModel->getError()]);
}
$param['user_id'] = $userInfo['id'];
if ($customerModel->updateDataById($param, $param['id'])) {
return resultArray(['data' => '编辑成功']);
} else {
return resultArray(['error' => $customerModel->getError()]);
}
}
7、删除客户功能模块代码
public function