You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
42 lines
1.1 KiB
12 months ago
|
<?php
|
||
|
|
||
|
namespace app\controller\service;
|
||
|
|
||
|
use app\common\repositories\system\merchant\MerchantRepository;
|
||
|
use crmeb\basic\BaseController;
|
||
|
|
||
|
class Common extends BaseController
|
||
|
{
|
||
|
public function info()
|
||
|
{
|
||
|
$merId = $this->request->merId();
|
||
|
if ($merId) {
|
||
|
$merchant = app()->make(MerchantRepository::class)->get($merId);
|
||
|
$data = [
|
||
|
'mer_id' => $merchant['mer_id'],
|
||
|
'avatar' => $merchant['mer_avatar'],
|
||
|
'name' => $merchant['mer_name'],
|
||
|
];
|
||
|
} else {
|
||
|
$config = systemConfig(['site_logo', 'site_name','login_logo']);
|
||
|
$data = [
|
||
|
'mer_id' => 0,
|
||
|
'avatar' => $config['login_logo'],
|
||
|
'name' => $config['site_name'],
|
||
|
];
|
||
|
}
|
||
|
return app('json')->success($data);
|
||
|
}
|
||
|
|
||
|
public function user()
|
||
|
{
|
||
|
$admin = $this->request->adminInfo();
|
||
|
return app('json')->success($admin->hidden(['pwd', 'merchant'])->toArray());
|
||
|
}
|
||
|
|
||
|
public function config()
|
||
|
{
|
||
|
return app('json')->success(systemConfig(['site_name', 'site_logo', 'beian_sn']));
|
||
|
}
|
||
|
}
|