其余文件
This commit is contained in:
39
app/admin/controller/setting/CustomerService.php
Normal file
39
app/admin/controller/setting/CustomerService.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\server\JsonServer;
|
||||
use app\common\server\UrlServer;
|
||||
|
||||
class CustomerService extends AdminBase
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$image = ConfigServer::get('customer_service', 'image', '');
|
||||
$image = $image ? UrlServer::getFileUrl($image) : '';
|
||||
$config = [
|
||||
'type' => ConfigServer::get('customer_service', 'type', 1),
|
||||
'wechat' => ConfigServer::get('customer_service', 'wechat', ''),
|
||||
'phone' => ConfigServer::get('customer_service', 'phone', ''),
|
||||
'business_time' => ConfigServer::get('customer_service', 'business_time', ''),
|
||||
'image' => $image,
|
||||
];
|
||||
return view('', [
|
||||
'config' => $config
|
||||
]);
|
||||
}
|
||||
|
||||
public function set()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
ConfigServer::set('customer_service', 'type', $post['type']);
|
||||
ConfigServer::set('customer_service', 'wechat', $post['wechat']);
|
||||
ConfigServer::set('customer_service', 'phone', $post['phone']);
|
||||
ConfigServer::set('customer_service', 'business_time', $post['business_time']);
|
||||
if(isset($post['image'])){
|
||||
ConfigServer::set('customer_service', 'image', clearDomain($post['image']));
|
||||
}
|
||||
return JsonServer::success('设置成功');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user