123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788 |
- <?php
- namespace addons\unishop;
- use app\common\library\Menu;
- use think\Addons;
- use think\Loader;
- /**
- * 插件
- */
- class unishop extends Addons
- {
- /**
- * 插件安装方法
- * @return bool
- */
- public function install()
- {
- $menu = [
- 0 =>
- [
- 'name' => 'unishop',
- 'title' => 'uniShop移动商城',
- 'icon' => 'fa fa-font-awesome',
- 'remark' => '',
- 'sublist' =>
- [
- 0 =>
- [
- 'name' => 'unishop/ads',
- 'title' => '广告图管理',
- 'remark' => '',
- 'icon' => 'fa fa-buysellads',
- 'sublist' =>
- [
- 0 =>
- [
- 'name' => 'unishop/ads/index',
- 'title' => '查看',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 1 =>
- [
- 'name' => 'unishop/ads/add',
- 'title' => '添加',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 2 =>
- [
- 'name' => 'unishop/ads/edit',
- 'title' => '编辑',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 3 =>
- [
- 'name' => 'unishop/ads/del',
- 'title' => '删除',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 4 =>
- [
- 'name' => 'unishop/ads/multi',
- 'title' => '批量更新',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- ],
- ],
- 1 =>
- [
- 'name' => 'unishop/category',
- 'title' => '分类管理',
- 'remark' => '注意:产品只支持二级分类。',
- 'icon' => 'fa fa-align-justify',
- 'sublist' =>
- [
- 0 =>
- [
- 'name' => 'unishop/category/index',
- 'title' => '查看',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 1 =>
- [
- 'name' => 'unishop/category/del',
- 'title' => '删除',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 2 =>
- [
- 'name' => 'unishop/category/edit',
- 'title' => '修改',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 3 =>
- [
- 'name' => 'unishop/category/add',
- 'title' => '添加',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 4 =>
- [
- 'name' => 'unishop/category/multi',
- 'title' => '批量操作',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- ],
- ],
- 2 =>
- [
- 'name' => 'unishop/product',
- 'title' => '产品管理',
- 'remark' => '',
- 'icon' => 'fa fa-product-hunt',
- 'sublist' =>
- [
- 0 =>
- [
- 'name' => 'unishop/product/index',
- 'title' => '查看',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 1 =>
- [
- 'name' => 'unishop/product/add',
- 'title' => '添加',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 2 =>
- [
- 'name' => 'unishop/product/edit',
- 'title' => '编辑',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 3 =>
- [
- 'name' => 'unishop/product/del',
- 'title' => '删除',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 4 =>
- [
- 'name' => 'unishop/product/multi',
- 'title' => '批量更新',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 5 =>
- [
- 'name' => 'unishop/product/recyclebin',
- 'title' => '回收站',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 6 =>
- [
- 'name' => 'unishop/product/destroy',
- 'title' => '真是删除',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 7 =>
- [
- 'name' => 'unishop/product/restore',
- 'title' => '还原',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 8 =>
- [
- 'name' => 'unishop/product/copy',
- 'title' => '复制',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- ],
- ],
- 3 =>
- [
- 'name' => 'unishop/delivery',
- 'title' => '运费模板',
- 'remark' => '',
- 'icon' => 'fa fa-delicious',
- 'sublist' =>
- [
- 0 =>
- [
- 'name' => 'unishop/delivery/index',
- 'title' => '查看',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 1 =>
- [
- 'name' => 'unishop/delivery/add',
- 'title' => '添加',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 2 =>
- [
- 'name' => 'unishop/delivery/edit',
- 'title' => '编辑',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 3 =>
- [
- 'name' => 'unishop/delivery/del',
- 'title' => '删除',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 4 =>
- [
- 'name' => 'unishop/delivery/multi',
- 'title' => '批量更新',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- ],
- ],
- 4 =>
- [
- 'name' => 'unishop/config',
- 'title' => '系统配置',
- 'remark' => '更新配置缓存不会立即生效,如需立即生效请清空缓存。',
- 'icon' => 'fa fa-certificate',
- 'sublist' =>
- [
- 0 =>
- [
- 'name' => 'unishop/config/index',
- 'title' => '查看',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 1 =>
- [
- 'name' => 'unishop/config/add',
- 'title' => '添加',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 2 =>
- [
- 'name' => 'unishop/config/edit',
- 'title' => '编辑',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 3 =>
- [
- 'name' => 'unishop/config/del',
- 'title' => '删除',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 4 =>
- [
- 'name' => 'unishop/config/multi',
- 'title' => '批量更新',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- ],
- ],
- 5 =>
- [
- 'name' => 'unishop/market',
- 'title' => '营销中心',
- 'remark' => '',
- 'icon' => 'fa fa-list',
- 'sublist' =>
- [
- 0 =>
- [
- 'name' => 'unishop/market/coupon',
- 'title' => '优惠券管理',
- 'remark' => '',
- 'icon' => 'fa fa-gratipay',
- 'sublist' =>
- [
- 0 =>
- [
- 'name' => 'unishop/market/coupon/index',
- 'title' => '查看',
- 'icon' => 'fa fa-circle-o',
- ],
- 1 =>
- [
- 'name' => 'unishop/market/coupon/add',
- 'title' => '添加',
- 'icon' => 'fa fa-circle-o',
- ],
- 2 =>
- [
- 'name' => 'unishop/market/coupon/edit',
- 'title' => '编辑',
- 'icon' => 'fa fa-circle-o',
- ],
- 3 =>
- [
- 'name' => 'unishop/market/coupon/del',
- 'title' => '删除',
- 'icon' => 'fa fa-circle-o',
- ],
- 4 =>
- [
- 'name' => 'unishop/market/coupon/multi',
- 'title' => '批量更新',
- 'icon' => 'fa fa-circle-o',
- ],
- 5 =>
- [
- 'name' => 'unishop/market/coupon/recyclebin',
- 'title' => '回收站',
- 'icon' => 'fa fa-circle-o',
- ],
- 6 =>
- [
- 'name' => 'unishop/market/coupon/destroy',
- 'title' => '真实删除',
- 'icon' => 'fa fa-circle-o',
- ],
- 7 =>
- [
- 'name' => 'unishop/market/coupon/restore',
- 'title' => '还原',
- 'icon' => 'fa fa-circle-o',
- ],
- ],
- ],
- 1 =>
- [
- 'name' => 'unishop/market/flash_sale',
- 'title' => '秒杀管理',
- 'remark' => '1,归档结束会把商品的真实售量和剩余数量同步到对应商品。
- 2,已归档、已开始、上架状态的秒杀信息不能够修改。
- 3,商品列表下架的商品也可以参与秒杀,建议复制一份商品专门提供给秒杀使用。
- 4,秒杀进行中的商品可以单个下架。
- 5,必须启动redis才能使用秒杀功能',
- 'icon' => 'fa fa-flag',
- 'sublist' =>
- [
- 0 =>
- [
- 'name' => 'unishop/market/flash_sale/index',
- 'title' => '查看',
- 'icon' => 'fa fa-circle-o',
- ],
- 1 =>
- [
- 'name' => 'unishop/market/flash_sale/add',
- 'title' => '添加',
- 'icon' => 'fa fa-circle-o',
- ],
- 2 =>
- [
- 'name' => 'unishop/market/flash_sale/edit',
- 'title' => '编辑',
- 'icon' => 'fa fa-circle-o',
- ],
- 3 =>
- [
- 'name' => 'unishop/market/flash_sale/del',
- 'title' => '删除',
- 'icon' => 'fa fa-circle-o',
- ],
- 4 =>
- [
- 'name' => 'unishop/market/flash_sale/multi',
- 'title' => '批量更新',
- 'icon' => 'fa fa-circle-o',
- ],
- 5 =>
- [
- 'name' => 'unishop/market/flash_sale/recyclebin',
- 'title' => '回收站',
- 'icon' => 'fa fa-circle-o',
- ],
- 6 =>
- [
- 'name' => 'unishop/market/flash_sale/destroy',
- 'title' => '真实删除',
- 'icon' => 'fa fa-circle-o',
- ],
- 7 =>
- [
- 'name' => 'unishop/market/flash_sale/restroy',
- 'title' => '还原',
- 'icon' => 'fa fa-circle-o',
- ],
- 8 =>
- [
- 'name' => 'unishop/market/flash_product/multi',
- 'title' => '更新秒杀产品状态',
- 'icon' => 'fa fa-circle-o',
- ],
- ],
- ],
- ],
- ],
- 6 =>
- [
- 'name' => 'unishop/order',
- 'title' => '订单管理',
- 'remark' => '1,货到付款默认支付状态为已支付,请留意发快递的时候选择收付模式。',
- 'icon' => 'fa fa-print',
- 'sublist' =>
- [
- 0 =>
- [
- 'name' => 'unishop/order/delivery',
- 'title' => '物流管理',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 1 =>
- [
- 'name' => 'unishop/order/multi',
- 'title' => '批量更新',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 2 =>
- [
- 'name' => 'unishop/order/restore',
- 'title' => '还原',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 3 =>
- [
- 'name' => 'unishop/order/destroy',
- 'title' => '真实删除',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 4 =>
- [
- 'name' => 'unishop/order/del',
- 'title' => '删除',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 5 =>
- [
- 'name' => 'unishop/order/edit',
- 'title' => '编辑',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 6 =>
- [
- 'name' => 'unishop/order/recyclebin',
- 'title' => '回收站',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 7 =>
- [
- 'name' => 'unishop/order/index',
- 'title' => '查看',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 8 =>
- [
- 'name' => 'unishop/order/product',
- 'title' => '商品管理',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 9 =>
- [
- 'name' => 'unishop/order/refund',
- 'title' => '退货',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- ],
- ],
- 7 =>
- [
- 'name' => 'unishop/evaluate',
- 'title' => '商品评价管理',
- 'remark' => '',
- 'icon' => 'fa fa-commenting',
- 'sublist' =>
- [
- 0 =>
- [
- 'name' => 'unishop/evaluate/index',
- 'title' => '查看',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 1 =>
- [
- 'name' => 'unishop/evaluate/recyclebin',
- 'title' => '回收站',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 2 =>
- [
- 'name' => 'unishop/evaluate/add',
- 'title' => '添加',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 3 =>
- [
- 'name' => 'unishop/evaluate/edit',
- 'title' => '编辑',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 4 =>
- [
- 'name' => 'unishop/evaluate/del',
- 'title' => '删除',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 5 =>
- [
- 'name' => 'unishop/evaluate/destroy',
- 'title' => '真实删除',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 6 =>
- [
- 'name' => 'unishop/evaluate/restore',
- 'title' => '还原',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- 7 =>
- [
- 'name' => 'unishop/evaluate/multi',
- 'title' => '批量更新',
- 'remark' => '',
- 'icon' => 'fa fa-circle-o',
- 'sublist' =>
- [
- ],
- ],
- ],
- ],
- 8 => [
- "type" => "file",
- "name" => "unishop/dashboard",
- "title" => "仪表盘统计",
- "icon" => "fa fa-dashboard",
- "condition" => "",
- "remark" => "",
- "ismenu" => 1,
- "sublist" => [
- [
- "type" => "file",
- "name" => "unishop/dashboard/index",
- "title" => "查看",
- "icon" => "fa fa-circle-o",
- "condition" => "",
- "remark" => "",
- "ismenu" => 0
- ],
- [
- "type" => "file",
- "name" => "unishop/dashboard/income",
- "title" => "营收统计",
- "icon" => "fa fa-circle-o",
- "condition" => "",
- "remark" => "",
- "ismenu" => 0
- ],
- [
- "type" => "file",
- "name" => "unishop/dashboard/goods",
- "title" => "商品销量",
- "icon" => "fa fa-circle-o",
- "condition" => "",
- "remark" => "",
- "ismenu" => 0
- ],
- ]
- ],
- ],
- ],
- ];
- Menu::create($menu);
- return true;
- }
- /**
- * 插件卸载方法
- * @return bool
- */
- public function uninstall()
- {
- Menu::delete('unishop');
- return true;
- }
- /**
- * 插件启用方法
- * @return bool
- */
- public function enable()
- {
- Menu::enable('unishop');
- return true;
- }
- /**
- * 插件禁用方法
- * @return bool
- */
- public function disable()
- {
- Menu::disable('unishop');
- return true;
- }
- public function appInit()
- {
- Loader::addNamespace('Hashids', ADDON_PATH . 'unishop' . DS . 'library' . DS . 'Hashids' . DS);
- Loader::addNamespace('Godruoyi\Snowflake', ADDON_PATH . 'unishop' . DS . 'library' . DS . 'Godruoyi' . DS . 'Snowflake' . DS);
- Loader::addNamespace('Yansongda', ADDON_PATH . 'epay' . DS . 'library' . DS . 'Yansongda' . DS);
- }
- }
|