Prepare FUC-XB web support integration
This commit is contained in:
1 parent
2c92a857e8
commit
fa706edeb6
22 files changed
+1164
-2
No files matched your search
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace App\Services\CustomerService;
|
||||
|
||||
class Settings
|
||||
{
|
||||
public const DEFAULTS = [
|
||||
'enabled' => false, 'base_url' => '', 'website_token' => '',
|
||||
'working_hours' => '工作日早9点至晚5点',
|
||||
'offline_title' => '当前没有在线客服',
|
||||
'offline_message' => '您可以在这里留言,客服上线后会尽快回复。',
|
||||
'ticket_url' => '/#/tickets', 'telegram_enabled' => false,
|
||||
'telegram_bot_code' => 'base', 'telegram_target_code' => 'base',
|
||||
];
|
||||
public function all(): array
|
||||
{
|
||||
return array_replace(self::DEFAULTS, array_intersect_key((array) admin_setting('customer_service', []), self::DEFAULTS));
|
||||
}
|
||||
public function publicConfig(): array
|
||||
{
|
||||
return array_diff_key($this->all(), array_flip(['telegram_enabled','telegram_bot_code','telegram_target_code']))
|
||||
+ ['online_count'=>max(0,min(3,(int)admin_setting('customer_service_display_count',1)))];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user