|
@@ -10,6 +10,7 @@ use think\exception\DbException;
|
|
|
use think\exception\PDOException;
|
|
|
use think\exception\ValidateException;
|
|
|
use fast\Random;
|
|
|
+use app\common\library\Tenim;
|
|
|
|
|
|
/**
|
|
|
* 维保公司管理
|
|
@@ -77,6 +78,10 @@ class Company extends Backend
|
|
|
|
|
|
//第一个管理员
|
|
|
$company_id = $this->model->id;
|
|
|
+ //注册到im
|
|
|
+ //user_用户端小程序,master_师傅,kefu_客服
|
|
|
+ $tenim = new Tenim();
|
|
|
+ $rs = $tenim->register('kefu_'. $company_id, $params['companyname'], localpath_to_netpath($params['avatar']));
|
|
|
//添加一个管理组
|
|
|
$auth_group = ['company_id'=>$company_id,'pid'=>0,'name'=>'最高级管理','code'=>'super_admin','rules'=>'*','createtime'=>time(),'updatetime'=>time(),'status'=>'normal',];
|
|
|
$group_id = Db::name('pc_auth_group')->insertGetId($auth_group);
|