139 lines
5.2 KiB
PHP
139 lines
5.2 KiB
PHP
<?php
|
|
namespace Yunshop\WeightValue;
|
|
|
|
|
|
|
|
class PluginApplication extends \app\common\services\PluginApplication{
|
|
|
|
protected function setMenuConfig(){
|
|
|
|
return [];
|
|
\app\backend\modules\menu\Menu::current()->setPluginMenu('weight-value', [
|
|
'name' => '权重值管理',
|
|
'type' => 'marketing',
|
|
'url' => 'plugin.weight-value.admin.index.index',// url 可以填写http 也可以直接写路由
|
|
'url_params' => '',//如果是url填写的是路由则启用参数否则不启用
|
|
'permit' => 1,//如果不设置则不会做权限检测
|
|
'menu' => 1,//如果不设置则不显示菜单,子菜单也将不显示
|
|
'icon' => '',//菜单图标
|
|
'list_icon' => 'weight-value',
|
|
'parents' => [],
|
|
'top_show' => 0,
|
|
'left_first_show' => 0,
|
|
'left_second_show' => 1,
|
|
'child' => [
|
|
'plugin_weigh_value_index' => [
|
|
'name' => '权重值明细',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'url' => 'plugin.weight-value.admin.index.index',
|
|
'url_params' => '',
|
|
'item' => 'plugin_weigh_value_index',
|
|
'parents' => ['weight-value'],
|
|
'child' => [
|
|
// 权限补充
|
|
'plugin_weigh_value_index_index' => [
|
|
'name' => '权重值明细',
|
|
'url' => 'plugin.weight-value.admin.index.index',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 0,
|
|
'icon' => '',
|
|
'item' => 'plugin_weigh_value_index_index',
|
|
'parents' => ['weight-value','plugin_weigh_value_index']
|
|
],
|
|
'plugin_weigh_value_index_record' => [
|
|
'name' => '变更记录',
|
|
'url' => 'plugin.weight-value.admin.index.record',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 0,
|
|
'icon' => '',
|
|
'item' => 'plugin_weigh_value_index_record',
|
|
'parents' => ['weight-value','plugin_weigh_value_index']
|
|
],
|
|
]
|
|
],
|
|
'plugin_weigh_value_transfer' => [
|
|
'name' => '转账明细',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'url' => 'plugin.weight-value.admin.transfer.index',
|
|
'url_params' => '',
|
|
'parents' => ['weight-value'],
|
|
'child' => [
|
|
// 权限补充
|
|
'plugin_weigh_value_transfer_index' => [
|
|
'name' => '转账明细',
|
|
'url' => 'plugin.weight-value.admin.transfer.index',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 0,
|
|
'icon' => '',
|
|
'item' => 'plugin_weigh_value_transfer_index',
|
|
'parents' => ['weight-value','plugin_weigh_value_transfer']
|
|
],
|
|
]
|
|
],
|
|
'plugin_weigh_value_set' => [
|
|
'name' => '基本设置',
|
|
'permit' => 1,
|
|
'menu' => 1,
|
|
'icon' => '',
|
|
'url' => 'plugin.weight-value.admin.index.set',
|
|
'url_params' => '',
|
|
'parents' => ['weight-value'],
|
|
'child' => [
|
|
// 权限补充
|
|
'plugin_weigh_value_index_set' => [
|
|
'name' => '基本设置',
|
|
'url' => 'plugin.weight-value.admin.index.set',
|
|
'url_params' => '',
|
|
'permit' => 1,
|
|
'menu' => 0,
|
|
'icon' => '',
|
|
'item' => 'plugin_weigh_value_index_set',
|
|
'parents' => ['weight-value', 'plugin_weigh_value_set'],
|
|
]
|
|
]
|
|
],
|
|
]
|
|
]);
|
|
}
|
|
|
|
|
|
public function getWidgetItems()
|
|
{
|
|
return [
|
|
'vue-goods.weight_value' => [
|
|
'title' => '权重值',
|
|
'class' => \Yunshop\WeightValue\admin\widget\WeightValueWidget::class,
|
|
],
|
|
];
|
|
}
|
|
|
|
protected function setConfig(){
|
|
\app\common\modules\shop\ShopConfig::current()->set(
|
|
'observer.goods.weight_value', [
|
|
'class' => 'Yunshop\WeightValue\models\GoodsWeightValue',
|
|
// 'function_validator'=>'relationValidator',
|
|
'function_save' => 'relationSave'
|
|
]
|
|
);
|
|
}
|
|
|
|
public function boot(){
|
|
$events = app('events');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} |