修改飞书消息配置
This commit is contained in:
@@ -9,11 +9,21 @@ class FeishuMessage
|
|||||||
|
|
||||||
protected $app_id = 'cli_a6183b882cb8500d';
|
protected $app_id = 'cli_a6183b882cb8500d';
|
||||||
protected $app_secret = 'VqYib48u4EtDIa6nG9qH3f0fYCA1bCvs';
|
protected $app_secret = 'VqYib48u4EtDIa6nG9qH3f0fYCA1bCvs';
|
||||||
|
protected $state = 'hesu';
|
||||||
protected $class = null;
|
protected $class = null;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct($options = [])
|
||||||
{
|
{
|
||||||
$this->class = new Feishu($this->app_id, $this->app_secret);
|
if (isset($options['app_id']) && $options['app_id']) {
|
||||||
|
$this->app_id = $options['app_id'];
|
||||||
|
}
|
||||||
|
if (isset($options['app_secret']) && $options['app_secret']) {
|
||||||
|
$this->app_secret = $options['app_secret'];
|
||||||
|
}
|
||||||
|
if (isset($options['state']) && $options['state']) {
|
||||||
|
$this->state = $options['state'];
|
||||||
|
}
|
||||||
|
$this->class = new Feishu($this->app_id, $this->app_secret, $this->state);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ class FeishuMessage implements Consumer
|
|||||||
|
|
||||||
'app_id' => $feishuAppInfo->app_id,
|
'app_id' => $feishuAppInfo->app_id,
|
||||||
'app_secret' => $feishuAppInfo->app_secret,
|
'app_secret' => $feishuAppInfo->app_secret,
|
||||||
|
'state' => $feishuAppInfo->state,
|
||||||
'msg_type' => 'interactive',
|
'msg_type' => 'interactive',
|
||||||
'receive_id_type' => 'open_id',
|
'receive_id_type' => 'open_id',
|
||||||
'receive_id' => $reInfo->open_id
|
'receive_id' => $reInfo->open_id
|
||||||
@@ -64,6 +65,7 @@ class FeishuMessage implements Consumer
|
|||||||
if ($data['receive_type'] == 'group') {
|
if ($data['receive_type'] == 'group') {
|
||||||
$appId = 'cli_a6183b882cb8500d';
|
$appId = 'cli_a6183b882cb8500d';
|
||||||
$appSecret = 'VqYib48u4EtDIa6nG9qH3f0fYCA1bCvs';
|
$appSecret = 'VqYib48u4EtDIa6nG9qH3f0fYCA1bCvs';
|
||||||
|
$state = 'hesu';
|
||||||
$receiveId = 'oc_a52d9f89ad76735279088c78beade8dc';
|
$receiveId = 'oc_a52d9f89ad76735279088c78beade8dc';
|
||||||
$receiveIdType = 'chat_id';
|
$receiveIdType = 'chat_id';
|
||||||
} else {
|
} else {
|
||||||
@@ -75,6 +77,7 @@ class FeishuMessage implements Consumer
|
|||||||
// 推送信息
|
// 推送信息
|
||||||
$appId = $feishuAppInfo->app_id;
|
$appId = $feishuAppInfo->app_id;
|
||||||
$appSecret = $feishuAppInfo->app_secret;
|
$appSecret = $feishuAppInfo->app_secret;
|
||||||
|
$state = $feishuAppInfo->state;
|
||||||
$receiveId = $reInfo->open_id;
|
$receiveId = $reInfo->open_id;
|
||||||
$receiveIdType = 'open_id';
|
$receiveIdType = 'open_id';
|
||||||
}
|
}
|
||||||
@@ -91,13 +94,14 @@ class FeishuMessage implements Consumer
|
|||||||
|
|
||||||
'app_id' => $appId,
|
'app_id' => $appId,
|
||||||
'app_secret' => $appSecret,
|
'app_secret' => $appSecret,
|
||||||
|
'state' => $state,
|
||||||
'msg_type' => 'interactive',
|
'msg_type' => 'interactive',
|
||||||
'receive_id_type' => $receiveIdType,
|
'receive_id_type' => $receiveIdType,
|
||||||
'receive_id' => $receiveId
|
'receive_id' => $receiveId
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
$feishuMsg = new FeishuMsg();
|
$feishuMsg = new FeishuMsg($options);
|
||||||
$feishuMsg->messageSend($data['scene'], $options);
|
$feishuMsg->messageSend($data['scene'], $options);
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
throw $th;
|
throw $th;
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ class InquiryToCrm implements Consumer
|
|||||||
try {
|
try {
|
||||||
// 获取询盘信息
|
// 获取询盘信息
|
||||||
$info = InquiryLog::with(['channelInfo', 'countryInfo', 'enter'])->where('id', $data['id'])->where('sync_crm', 0)->first();
|
$info = InquiryLog::with(['channelInfo', 'countryInfo', 'enter'])->where('id', $data['id'])->where('sync_crm', 0)->first();
|
||||||
|
|
||||||
if ($info) {
|
if ($info) {
|
||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
$recipient = 0;
|
$recipient = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user