feat: 初始化雄戈商城服务端代码与Webhook自动部署配置
这个提交包含在:
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace addons\shopro_aliyun_express;
|
||||
|
||||
use addons\shopro_aliyun_express\library\Installer;
|
||||
use app\common\library\Menu;
|
||||
use think\Addons;
|
||||
|
||||
class Shopro_aliyun_express extends Addons
|
||||
{
|
||||
public function install()
|
||||
{
|
||||
Installer::run();
|
||||
return true;
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
$sql = file_get_contents(__DIR__ . '/uninstall.sql');
|
||||
$prefix = config('database.prefix');
|
||||
$sql = str_replace('__PREFIX__', $prefix, $sql);
|
||||
$statements = array_filter(array_map('trim', explode(';', $sql)));
|
||||
foreach ($statements as $statement) {
|
||||
if ($statement !== '') {
|
||||
try {
|
||||
\think\Db::execute($statement);
|
||||
} catch (\Exception $e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
Menu::delete('shopro_aliyun_express');
|
||||
Menu::delete('shopro_aliyun_express/config');
|
||||
Menu::delete('shopro_aliyun_express/query');
|
||||
return true;
|
||||
}
|
||||
|
||||
public function enable()
|
||||
{
|
||||
Menu::enable('shopro_aliyun_express/config');
|
||||
Menu::enable('shopro_aliyun_express/query');
|
||||
return true;
|
||||
}
|
||||
|
||||
public function disable()
|
||||
{
|
||||
Menu::disable('shopro_aliyun_express/config');
|
||||
Menu::disable('shopro_aliyun_express/query');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户