feat: 初始化雄戈商城服务端代码与Webhook自动部署配置
这个提交包含在:
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
namespace addons\shopro\library\split;
|
||||
|
||||
|
||||
|
||||
use addons\shopro\model\split\Config as ConfigModel;
|
||||
|
||||
|
||||
|
||||
class Config
|
||||
|
||||
{
|
||||
|
||||
protected $config = [];
|
||||
|
||||
|
||||
|
||||
public function __construct()
|
||||
|
||||
{
|
||||
|
||||
$this->config = ConfigModel::column('value', 'name');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function isEnable()
|
||||
|
||||
{
|
||||
|
||||
return boolval($this->config['split_enable'] ?? 0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getMode()
|
||||
|
||||
{
|
||||
|
||||
return $this->config['split_mode'] ?? 'wechat';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function isHuifuMode()
|
||||
|
||||
{
|
||||
|
||||
if ($this->getMode() === 'huifu') {
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
$provider = $this->config['split_provider'] ?? 'auto';
|
||||
|
||||
if ($provider === 'huifu') {
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
if ($provider === 'auto' && class_exists('\\addons\\shopro_huifu\\library\\Bridge')) {
|
||||
|
||||
return \addons\shopro_huifu\library\Bridge::isHuifuMiniProgramChannel('wxMiniProgram');
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function shouldSkipWallet()
|
||||
|
||||
{
|
||||
|
||||
return in_array($this->getMode(), ['wechat', 'huifu', 'both']);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getTiming()
|
||||
在新工单中引用
屏蔽一个用户