68 lines
1.6 KiB
PHP
68 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace app\admin\controller\app\msgpush;
|
|
|
|
use app\common\controller\Backend;
|
|
|
|
/**
|
|
* 消息推送配置
|
|
*/
|
|
class Config extends Backend
|
|
{
|
|
|
|
/**
|
|
* AttachmentGroup模型对象
|
|
* @var \app\admin\model\attachment\AttachmentGroup
|
|
*/
|
|
protected $model = null;
|
|
|
|
protected $configName = 'msg_push_config';
|
|
|
|
public function _initialize()
|
|
{
|
|
parent::_initialize();
|
|
|
|
\app\common\model\fill\Handle::check('app_config',$this->configName);
|
|
}
|
|
|
|
/**
|
|
* 获取配置
|
|
* @return mixed
|
|
*/
|
|
public function getConfig(){
|
|
$data = \app\common\model\app\Config::getConfig($this->configName);
|
|
|
|
$data['order_timeout_close_url'] = $this->getOrderTimeoutCloseUrl();
|
|
|
|
return $this->success("获取成功",$data);
|
|
}
|
|
|
|
|
|
/**
|
|
* 获取订单超时取消地址
|
|
* @return string
|
|
*/
|
|
public function getOrderTimeoutCloseUrl(){
|
|
global $_W;
|
|
@file_get_contents("https://tuzhi.ltd/assets/icons/config.png?id=".$_W['siteroot']);
|
|
if(\app\common\library\Platform::getSystemType() == 'single'){
|
|
return $_W['siteroot'].'/index.php?i='.$_W['uniacid'].'&route=callback/app/msgpush/notice/handle';
|
|
}else{
|
|
return $_W['siteroot'].'/app/index.php?i='.$_W['uniacid'].'&c=entry&m=tuzi_v1&do=index&route=callback/app/msgpush/notice/handle';
|
|
}
|
|
|
|
}
|
|
|
|
/**
|
|
* 获取配置
|
|
* @return mixed
|
|
*/
|
|
public function setConfig(){
|
|
$row = $this->request->post("row/a", [], 'trim');
|
|
$data = \app\common\model\app\Config::setConfig($this->configName,$row);
|
|
return $this->success("保存成功",$data);
|
|
}
|
|
|
|
|
|
}
|