193 lines
7.6 KiB
PHP
193 lines
7.6 KiB
PHP
<?php
|
|
|
|
|
|
namespace Yunshop\Redpack;
|
|
|
|
|
|
use Yunshop\Redpack\Listener\RegisterBindMobileListener;
|
|
use Yunshop\Redpack\Listener\OrderPaidListener;
|
|
|
|
class PluginApplication extends \app\common\services\PluginApplication
|
|
{
|
|
public function getTemplateItems()
|
|
{
|
|
return [];
|
|
}
|
|
|
|
protected function setConfig()
|
|
{
|
|
|
|
}
|
|
|
|
protected function setMenuConfig()
|
|
{
|
|
/**
|
|
* 菜单、权限、路由
|
|
*/
|
|
\app\backend\modules\menu\Menu::current()->setPluginMenu('redpack', [
|
|
'name' => '口令红包',
|
|
'type' => 'marketing',
|
|
'url' => 'plugin.redpack.admin.redpack.manage.index',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'top_show' => 0,
|
|
'left_first_show' => 0,
|
|
'left_second_show' => 1,
|
|
'icon' => 'fa-retweet',
|
|
'list_icon' => 'full_return',
|
|
'item' => 'full_return',
|
|
'parents' => [],
|
|
'child' => [
|
|
'redpack_manage' => [
|
|
'name' => '活动管理',
|
|
'url' => 'plugin.redpack.admin.redpack.manage.index',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'redpack_manage',
|
|
'parents' => ['redpack'],
|
|
'child' => [
|
|
'redpack_manage_add' => [
|
|
'name' => '添加活动',
|
|
'url' => 'plugin.redpack.admin.redpack.add.index',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 0,
|
|
'icon' => '',
|
|
'item' => 'redpack_manage_add',
|
|
'parents' => ['redpack', 'redpack_manage'],
|
|
'child' => [
|
|
'redpack_manage_get_local_list' => [
|
|
'name' => '获取图片',
|
|
'url' => 'plugin.redpack.admin.upload.getLocalList',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 0,
|
|
'icon' => '',
|
|
'item' => 'redpack_manage_add',
|
|
'parents' => ['redpack', 'redpack_manage','redpack_manage_add'],
|
|
],
|
|
'redpack_manage_add_data' => [
|
|
'name' => '保存数据',
|
|
'url' => 'plugin.redpack.admin.redpack.store.index',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 0,
|
|
'icon' => '',
|
|
'item' => 'redpack_manage_add_data',
|
|
'parents' => ['redpack', 'redpack_manage','redpack_manage_add'],
|
|
],
|
|
|
|
]
|
|
],
|
|
'redpack_manage_edit' => [
|
|
'name' => '编辑活动',
|
|
'url' => 'plugin.redpack.admin.redpack.edit.index',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 0,
|
|
'icon' => '',
|
|
'item' => 'redpack_manage_edit',
|
|
'parents' => ['redpack', 'redpack_manage'],
|
|
'child' => []
|
|
],
|
|
'redpack_manage_get_goods' => [
|
|
'name' => '获取商品列表',
|
|
'url' => 'plugin.redpack.admin.redpack.manage.get-goods',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 0,
|
|
'icon' => '',
|
|
'item' => 'redpack_manage_get_goods',
|
|
'parents' => ['redpack', 'redpack_manage'],
|
|
'child' => []
|
|
],
|
|
'redpack_manage_get_category' => [
|
|
'name' => '获取商品分类',
|
|
'url' => 'plugin.redpack.admin.redpack.manage.get-category',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 0,
|
|
'icon' => '',
|
|
'item' => 'redpack_manage_get_category',
|
|
'parents' => ['redpack', 'redpack_manage'],
|
|
'child' => []
|
|
],
|
|
'redpack_manage_search' => [
|
|
'name' => '搜索商品(包括上下页)',
|
|
'url' => 'plugin.redpack.admin.redpack.manage.search',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 0,
|
|
'icon' => '',
|
|
'item' => 'redpack_manage_search',
|
|
'parents' => ['redpack', 'redpack_manage'],
|
|
'child' => []
|
|
],
|
|
]
|
|
],
|
|
'challenge_log' => [
|
|
'name' => '挑战记录',
|
|
'url' => 'plugin.redpack.admin.challenge.manage.index',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'item' => 'challenge_log',
|
|
'parents' => ['redpack'],
|
|
'child' => [
|
|
'challenge_log_reissue' => [
|
|
'name' => '补发',
|
|
'url' => 'plugin.redpack.admin.challenge.reissue.index',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 0,
|
|
'icon' => '',
|
|
'item' => 'challenge_log_reissue',
|
|
'parents' => ['redpack', 'challenge_log'],
|
|
'child' => []
|
|
],
|
|
'challenge_manage_search' => [
|
|
'name' => '搜索商品(包括上下页)',
|
|
'url' => 'plugin.redpack.admin.challenge.manage.search',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 0,
|
|
'icon' => '',
|
|
'item' => 'challenge_manage_search',
|
|
'parents' => ['redpack', 'challenge_log'],
|
|
'child' => []
|
|
],
|
|
]
|
|
],
|
|
]
|
|
]);
|
|
}
|
|
|
|
/* public function getIncomeItems()
|
|
{
|
|
return ['redpack_income' => [
|
|
'title' => '口令红包',
|
|
'type' => 'redpack_withdraw',
|
|
// 'class' => AdvertViewLog::class,
|
|
'order_class' => '',
|
|
]];
|
|
}*/
|
|
|
|
public function boot()
|
|
{
|
|
$events = app('events');
|
|
|
|
$events->subscribe(OrderPaidListener::class);
|
|
|
|
$events->subscribe(RegisterBindMobileListener::class);
|
|
|
|
}
|
|
|
|
public function register()
|
|
{
|
|
//test
|
|
}
|
|
} |