manghe/app/api/controller/Config.php
2025-06-13 16:56:33 +08:00

56 lines
1.6 KiB
PHP
Executable File

<?php
declare(strict_types=1);
namespace app\api\controller;
use app\api\controller\Base;
use think\facade\Db;
use \think\Request;
class Config extends Base
{
/**
* 配置信息接口
* 返回盒子类型等配置信息
*/
public function index()
{
// 查询盒子类型数据
$goodsTypeList = Db::name('goods_type')
->field('value, sort_order,is_show, name,pay_wechat,pay_balance,pay_currency,pay_currency2,pay_coupon,is_deduction')
->order('sort_order')
->select()
->toArray();
$app_setting = getConfig('app_setting');
#客服
$base_rule = getConfig('base');
// 'is_shou_tan' => $rule['is_shou_tan'],
// 'jump_appid' => $rule['jump_appid'],
// 'corpid' => $rule['corpid'],
// 'wx_link' => $rule['wx_link'],
$base_config = [
'is_shou_tan' => $base_rule['is_shou_tan'],
'jump_appid' => $base_rule['jump_appid'],
'corpid' => $base_rule['corpid'],
'wx_link' => $base_rule['wx_link']
];
// 返回数据
return $this->renderSuccess('获取成功', [
'good_type' => $goodsTypeList,
'app_setting' => $app_setting,
'base_config' => $base_config,
'version' => '116'
]);
}
/**
* 获取平台配置
* @return \think\response\Json
*/
public function getPlatformConfig()
{
$platform = \app\common\server\platform\PlatformFactory::create();
$config = $platform->get_config();
return $this->renderSuccess("", $config);
}
}