Litestore.php
5.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?php
namespace addons\litestore;
use app\common\library\Menu;
use think\Addons;
/**
* 插件
*/
class Litestore extends Addons
{
/**
* 插件安装方法
* @return bool
*/
public function install()
{
$menu = [
[
'name' => 'litestore',
'title' => '移动端商城',
'icon' => 'fa fa-shopping-basket',
'sublist' => [
[
'name' => 'litestorenews',
'title' => '首页banner',
'icon' => 'fa fa-image',
'sublist' => [
['name' => 'litestorenews/index', 'title' => '查看'],
['name' => 'litestorenews/add', 'title' => '添加'],
['name' => 'litestorenews/edit', 'title' => '修改'],
['name' => 'litestorenews/del', 'title' => '删除'],
['name' => 'litestorenews/multi', 'title' => '批量更新'],
]
],
[
'name' => 'litestoregoods',
'title' => '商品设置',
'icon' => 'fa fa-gift',
'sublist' => [
['name' => 'litestoregoods/index', 'title' => '查看'],
['name' => 'litestoregoods/add', 'title' => '添加'],
['name' => 'litestoregoods/edit', 'title' => '修改'],
['name' => 'litestoregoods/del', 'title' => '删除'],
['name' => 'litestoregoods/multi', 'title' => '批量更新'],
['name' => 'litestoregoods/addSpec', 'title' => '增加规格'],
['name' => 'litestoregoods/addSpecValue', 'title' => '增加规格值'],
]
],
[
'name' => 'litestorecategory',
'title' => '商品分类',
'icon' => 'fa fa-th',
'sublist' => [
['name' => 'litestorecategory/index', 'title' => '查看'],
['name' => 'litestorecategory/add', 'title' => '添加'],
['name' => 'litestorecategory/edit', 'title' => '修改'],
['name' => 'litestorecategory/del', 'title' => '删除'],
['name' => 'litestorecategory/multi', 'title' => '批量更新'],
]
],
[
'name' => 'litestorefreight',
'title' => '运费模板设置',
'icon' => 'fa fa-train',
'sublist' => [
['name' => 'litestorefreight/index', 'title' => '查看'],
['name' => 'litestorefreight/add', 'title' => '添加'],
['name' => 'litestorefreight/edit', 'title' => '修改'],
['name' => 'litestorefreight/del', 'title' => '删除'],
['name' => 'litestorefreight/multi', 'title' => '批量更新'],
]
],
[
'name' => 'litestoreorder',
'title' => '订单管理',
'icon' => 'fa fa-tasks',
'sublist' => [
['name' => 'litestoreorder/index', 'title' => '查看'],
['name' => 'litestoreorder/add', 'title' => '添加'],
['name' => 'litestoreorder/edit', 'title' => '修改'],
['name' => 'litestoreorder/del', 'title' => '删除'],
['name' => 'litestoreorder/multi', 'title' => '批量更新'],
['name' => 'litestoreorder/detail', 'title' => '订单详情'],
]
],
]
]
];
Menu::create($menu);
return true;
}
/**
* 插件卸载方法
* @return bool
*/
public function uninstall()
{
Menu::delete('litestore');
return true;
}
/**
* 插件启用方法
* @return bool
*/
public function enable()
{
Menu::enable('litestore');
return true;
}
/**
* 插件禁用方法
* @return bool
*/
public function disable()
{
Menu::disable('litestore');
return true;
}
public function GetCfg(){
return $this->getConfig();
}
}