汪总电商平台
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.
wangzong/addons/wanlshop/Wanlshop.php

96 lines
1.9 KiB

3 weeks ago
<?php
namespace addons\wanlshop;
use app\common\library\Menu;
use think\Addons;
use think\Request;
use think\Console;
use think\Loader;
/**
* 插件
*/
class Wanlshop extends Addons
{
/**
* 插件安装方法
* @return bool
*/
public function install()
{
$menu = include ADDON_PATH . 'wanlshop' . DS . 'data' . DS . 'menu.php';
Menu::create($menu);
return true;
}
/**
* 插件卸载方法
* @return bool
*/
public function uninstall()
{
Menu::delete("wanlshop");
return true;
}
/**
* 插件启用方法
* @return bool
*/
public function enable()
{
Menu::enable("wanlshop");
return true;
}
/**
* 插件禁用方法
* @return bool
*/
public function disable()
{
Menu::disable("wanlshop");
return true;
}
/**
* 插件升级方法
*/
public function upgrade()
{
$menu = include ADDON_PATH . 'wanlshop' . DS . 'data' . DS . 'menu.php';
Menu::upgrade('wanlshop', $menu);
}
/**
* 添加命令行扩展
*/
public function appInit()
{
Console::addDefaultCommands([
'addons\\wanlshop\\library\\command\\Chat',
'addons\\wanlshop\\library\\command\\Order',
]);
Loader::addNamespace('WanlPay\Yansongda', ADDON_PATH . 'wanlshop' . DS . 'library' . DS . 'WanlPay' . DS . 'Yansongda' . DS);
Loader::addNamespace('WanlPay\Supports', ADDON_PATH . 'wanlshop' . DS . 'library' . DS . 'WanlPay' . DS . 'Supports' . DS);
}
/**
* 会员中心边栏后
* @return mixed
* @throws \Exception
*/
public function userSidenavAfter()
{
$request = Request::instance();
$actionname = strtolower($request->action());
$data = [
'actionname' => $actionname
];
return $this->fetch('view/hook/user_sidenav_after', $data);
}
}