639 行
43 KiB
PHP
可执行文件
639 行
43 KiB
PHP
可执行文件
<?php
|
|
|
|
namespace Retail\Business;
|
|
|
|
use Common\Business\Plug;
|
|
use Common\Model\JurisdictionGroupModel;
|
|
use Common\Model\JurisdictionListModel;
|
|
use Common\Model\RetailMerchantModel;
|
|
use Common\Model\RetailStoreAuthModel;
|
|
|
|
//[1.9.18]
|
|
|
|
/**
|
|
* 后台菜单栏
|
|
* Class Menu
|
|
* @package Retail\Business
|
|
*/
|
|
class Menu
|
|
{
|
|
protected $agent_id;
|
|
protected $merchant_id;
|
|
protected $store_id;
|
|
|
|
/**
|
|
* @param $param
|
|
* $param['login_type'] 登录类型 1合伙人 2代理商 3商户 4门店 5导购员 6收银员
|
|
* $param['agent_id'] 代理商ID
|
|
* $param['merchant_id'] 商户ID
|
|
* $param['store_id'] 门店ID
|
|
* $param['jurisdiction_group_id'] 权限组ID
|
|
* 获取后台登录的菜单栏
|
|
* @return array
|
|
*/
|
|
public function getMenu($param)
|
|
{
|
|
switch ($param['login_type']) {
|
|
case '1':
|
|
//合伙人
|
|
$menu = $this->getPartnerMenu();
|
|
break;
|
|
case '2':
|
|
//代理商
|
|
$this->agent_id = $param['agent_id'];
|
|
$menu = $this->getAgentMenu();
|
|
break;
|
|
case '3':
|
|
//商户
|
|
$this->merchant_id = $param['merchant_id'];
|
|
if (!empty($param['store_id'])) {
|
|
$this->store_id = $param['store_id'];
|
|
$menu = $this->getStoreMenu();
|
|
} else {
|
|
$menu = $this->getMerchantMenu();
|
|
}
|
|
break;
|
|
case '4':
|
|
//店长
|
|
$this->merchant_id = $param['merchant_id'];
|
|
$this->store_id = $param['store_id'];
|
|
$menu = $this->getStoreMenu();
|
|
break;
|
|
case '5':
|
|
//导购员
|
|
$menu = $this->getGuideMenu();
|
|
break;
|
|
default:
|
|
$menu = [];
|
|
}
|
|
$returnMenu = []; //一级菜单
|
|
if (!empty($menu)) {
|
|
$JurGroupModel = new JurisdictionGroupModel();
|
|
$jurisdiction_id = $JurGroupModel->getFindField(['id' => $param['jurisdiction_group_id']], 'jurisdiction_id');
|
|
if (empty($jurisdiction_id)) {
|
|
return [];
|
|
}
|
|
//拆分该用户以逗号拼接的权限ID
|
|
$authIds = explode(',', $jurisdiction_id);
|
|
foreach ($menu as $menu1) {
|
|
if (!$menu1) {
|
|
continue;
|
|
}
|
|
//一级菜单处理
|
|
if ($menu1['path']) {
|
|
if (in_array($menu1['id'], $authIds)) $returnMenu[] = $menu1;
|
|
} else {
|
|
$menu_2 = [];
|
|
//二级菜单处理
|
|
foreach ($menu1['list'] as $menu2) {
|
|
if ($menu2['path']) {
|
|
if (in_array($menu2['id'], $authIds)) $menu_2[] = $menu2;
|
|
} else {
|
|
$menu_3 = []; //三级菜单处理
|
|
foreach ($menu2['list'] as $menu3) {
|
|
if ($menu3['path']) {
|
|
if (in_array($menu3['id'], $authIds)) $menu_3[] = $menu3;
|
|
}
|
|
}
|
|
if (!empty($menu_3)) {
|
|
$temp = $menu2;
|
|
$temp['list'] = $menu_3;
|
|
$menu_2[] = $temp;
|
|
}
|
|
}
|
|
}
|
|
if (!empty($menu_2)) {
|
|
$temp = $menu1;
|
|
$temp['list'] = $menu_2;
|
|
$returnMenu[] = $temp;
|
|
}
|
|
}
|
|
}
|
|
if ($param['login_type'] == 3 && !empty($param['store_id'])) {
|
|
$arr = ["type" => 1, 'reBack' => 1, "name" => "返回", "icon" => "fa fa-mail-reply", "path" => "/index.php/Retail/Menu/index"];
|
|
array_unshift($returnMenu, $arr);
|
|
}
|
|
}
|
|
return $returnMenu;
|
|
}
|
|
|
|
/**
|
|
* 合伙人菜单栏
|
|
* @return array
|
|
*/
|
|
private function getPartnerMenu()
|
|
{
|
|
$Plug = new Plug();
|
|
$systemPlug = $Plug->systemPlugState(['identification_arr' => ['moneyguestpay', 'lakalapay', 'happypay']]);
|
|
return [
|
|
['id' => 1, 'name' => '首页', 'icon' => 'fa fa-home', 'path' => '/index.php/Admin/Index/home'],
|
|
['id' => 3, 'name' => '代理商管理', 'icon' => 'fa fa-wpexplorer', 'path' => '/index.php/Admin/Agent/index'],
|
|
['id' => 13, 'name' => '用户套餐组', 'icon' => 'fa fa-meetup', 'path' => '/index.php/Admin/Agentmeal/index'],
|
|
['id' => 16, 'name' => '代理商等级', 'icon' => 'fa fa-linode', 'path' => '/index.php/Admin/Usergroup/index'],
|
|
['id' => 20, 'name' => '商户管理', 'icon' => 'fa fa-user-circle-o', 'path' => '/index.php/Admin/Merchant/index'],
|
|
['id' => 23, 'name' => '分润管理', 'icon' => 'fa fa-free-code-camp', 'list' => [
|
|
['id' => 922, 'name' => '直连分润', 'path' => '/index.php/Admin/Continentflow/linkIndex'],
|
|
['id' => 24, 'name' => '新大陆分润', 'path' => '/index.php/Admin/Continentflow/index'],
|
|
['id' => 1179, 'name' => '云闪付分润', 'path' => '/index.php/Admin/Continentflow/union'],
|
|
$systemPlug['happypay'] ? ['id' => 1202, 'name' => '乐返分润', 'path' => '/index.php/Admin/Continentflow/happy'] : null,
|
|
$systemPlug['lakalapay'] ? ['id' => 1203, 'name' => '拉卡拉分润', 'path' => '/index.php/Admin/Continentflow/laKaLa'] : null,
|
|
$systemPlug['moneyguestpay'] ? ['id' => 1206, 'name' => '钱客云分润', 'path' => '/index.php/Admin/Continentflow/moneyQuest'] : null,
|
|
['id' => 25, 'name' => '提现管理', 'path' => '/index.php/Admin/Continentflow/cashManager'],
|
|
]],
|
|
['id' => 28, 'name' => '商品云库', 'icon' => 'fa fa-asterisk', 'path' => '/index.php/Super/GoodsCode/index'],
|
|
['id' => 29, 'name' => '网站OEM', 'icon' => 'fa fa-telegram', 'list' => [
|
|
['id' => 30, 'name' => '网站消息', 'path' => '/index.php/Admin/Information/index'],
|
|
['id' => 32, 'name' => '公司环境', 'path' => '/index.php/Admin/Environmental/index'],
|
|
['id' => 35, 'name' => '公司简介', 'path' => '/index.php/Admin/Introduce/index'],
|
|
['id' => 37, 'name' => '新闻中心', 'path' => '/index.php/Admin/Template/index'],
|
|
['id' => 41, 'name' => '产品中心', 'path' => '/index.php/Admin/Commodity/index'],
|
|
['id' => 41, 'name' => '资料中心', 'path' => '/index.php/Admin/Resource/index'],
|
|
['id' => 46, 'name' => '联系我们', 'path' => '/index.php/Admin/Concat/index'],
|
|
['id' => 48, 'name' => '联系方式', 'path' => '/index.php/Admin/Contact/index'],
|
|
['id' => 52, 'name' => 'Banner管理', 'path' => '/index.php/Admin/Banner/index'],
|
|
['id' => 56, 'name' => 'Logo设置', 'path' => '/index.php/Admin/Pic/index'],
|
|
['id' => 58, 'name' => '收银Logo', 'path' => '/index.php/Admin/Pic/logos'],
|
|
['id' => 60, 'name' => '模板设置', 'path' => '/index.php/Admin/Templatechoice/index'],
|
|
]],
|
|
['id' => 63, 'name' => '系统配置', 'icon' => 'fa fa-gear', 'list' => [
|
|
['id' => 64, 'name' => '系统设置', 'path' => '/index.php/Super/Config/index'],
|
|
['id' => 79, 'name' => '系统信息', 'path' => '/index.php/Admin/Sysinfo/index'],
|
|
['id' => 85, 'name' => '软件上传', 'path' => '/index.php/Super/App/applist'],
|
|
['id' => 93, 'name' => '微信公众号', 'path' => '/index.php/Admin/official/index'],
|
|
]],
|
|
|
|
['id' => 125, 'name' => '帮助中心', 'icon' => 'fa fa-question-circle', 'list' => [
|
|
['id' => 126, 'name' => '菜单', 'path' => '/index.php/Super/Help/index'],
|
|
['id' => 130, 'name' => '内容', 'path' => '/index.php/Super/Content/indexs'],
|
|
]],
|
|
['id' => 116, 'name' => '用户管理', 'icon' => 'fa fa-address-book', 'list' => [
|
|
['id' => 117, 'name' => '用户列表', 'path' => '/index.php/Admin/AdminJurUsers/index'],
|
|
['id' => 121, 'name' => '角色管理', 'path' => '/index.php/Admin/AdminRoles/index'],
|
|
]],
|
|
['id' => 134, 'name' => '图片管理', 'icon' => 'fa fa-picture-o', 'path' => '/index.php/Admin/ImageGallery/index'],
|
|
['id' => 1091, 'name' => '插件中心', 'icon' => 'fa fa-cube', 'list' => [
|
|
['id' => 62, 'name' => '插件列表', 'path' => '/index.php/Super/Plug/index'],
|
|
['id' => 1092, 'name' => '购买记录', 'path' => '/index.php/Super/Plug/purchaseRecord'],
|
|
]],
|
|
['id' => 137, 'name' => '清理缓存', 'icon' => 'fa fa-trash', 'path' => '/index.php/Admin/Ucache/index'],
|
|
// ['id' => 1018, 'name' => '硬件商城', 'icon' => 'fa fa-address-book', 'list' => [
|
|
// ['id' => 1019,'name' => '分类管理', 'path' => '/index.php/Admin/HardWare/categoryIndex'],
|
|
// ['id' => 1020,'name' => 'banner管理', 'path' => '/index.php/Admin/HardWare/banner'],
|
|
// ['id' => 1021,'name' => '适配系统管理', 'path' => '/index.php/Admin/HardWare/categoryEdit'],
|
|
// ['id' => 1022,'name' => '商品管理', 'path' => '/index.php/Admin/HardWare/shoplist'],
|
|
// ['id' => 1023,'name' => '我的快递', 'path' => '/index.php/Admin/HardWare/courier'],
|
|
// ['id' => 1024,'name' => '订单管理', 'path' => '/index.php/Admin/HardWare/order'],
|
|
// ]],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* 代理商菜单栏
|
|
* @return array
|
|
*/
|
|
private function getAgentMenu()
|
|
{
|
|
$Plug = new Plug();
|
|
$agentPlug = $Plug->agentPlugState(['agent_id' => $this->agent_id, 'identification_arr' => ['moneyguestpay', 'lakalapay', 'happypay']]);
|
|
return [
|
|
['id' => 138, 'name' => '首页', 'icon' => 'fa fa-home', 'path' => '/index.php/Agent/index/home'],
|
|
['id' => 139, 'name' => '商户管理', 'icon' => 'fa fa-user-circle-o', 'path' => '/index.php/Agent/Merchant/index'],
|
|
['id' => 149, 'name' => '分润管理', 'icon' => 'fa fa-telegram', 'list' => [
|
|
['id' => 921, 'name' => '直连分润', 'path' => '/index.php/Agent/Continentflow/linkIndex'],
|
|
['id' => 150, 'name' => '新大陆分润', 'path' => '/index.php/Agent/Continentflow/index'],
|
|
['id' => 1180, 'name' => '云闪付分润', 'path' => '/index.php/Agent/Continentflow/union'],
|
|
$agentPlug['happypay'] ? ['id' => 1204, 'name' => '乐返分润', 'path' => '/index.php/Agent/Continentflow/happy'] : null,
|
|
$agentPlug['lakalapay'] ? ['id' => 1205, 'name' => '拉卡拉分润', 'path' => '/index.php/Agent/Continentflow/laKaLa'] : null,
|
|
$agentPlug['moneyguestpay'] ? ['id' => 1207, 'name' => '钱客云分润', 'path' => '/index.php/Agent/Continentflow/moneyQuest'] : null,
|
|
['id' => 151, 'name' => '提现管理', 'path' => '/index.php/Agent/Continentflow/cashManager'],
|
|
]],
|
|
['id' => 153, 'name' => '消费记录', 'icon' => 'fa fa-money', 'path' => '/index.php/Agent/Recharge/index'],
|
|
['id' => 154, 'name' => '插件商城', 'icon' => 'fa fa-cogs', 'path' => '/index.php/Agent/Plug/index'],
|
|
['id' => 1192, 'name' => '用户管理', 'icon' => 'fa fa-address-book', 'list' => [
|
|
['id' => 159, 'name' => '用户列表', 'path' => '/index.php/Agent/AgentJurUsers/index'],
|
|
['id' => 155, 'name' => '角色管理', 'path' => '/index.php/Agent/AgentRoles/index'],
|
|
]]
|
|
];
|
|
}
|
|
|
|
/**
|
|
* 商户菜单栏
|
|
* @param bool $root 是否直接读取所有菜单 true是 false不是(根据权限判断)
|
|
* @return array
|
|
*/
|
|
private function getMerchantMenu($root = false)
|
|
{
|
|
if ($root) {
|
|
$mini_state = 2;
|
|
} else {
|
|
$MerchantModel = new RetailMerchantModel();
|
|
$mini_state = $MerchantModel->getFindField(['id' => $this->merchant_id], 'juris');
|
|
}
|
|
|
|
return [
|
|
['id' => 163, 'name' => '概况', 'showList' => true, 'icon' => 'fa fa-home', 'path' => '/index.php/Retail/Store/index'],
|
|
['id' => 164, 'name' => '门店', 'icon' => 'fa fa-building', 'list' => [
|
|
['id' => 165, 'name' => '门店管理', 'path' => '/index.php/Retail/Store/store'],
|
|
['id' => 1181, 'name' => '门店行业', 'path' => '/index.php/Retail/StoreIndustry/index'],
|
|
['id' => 175, 'name' => '销售统计', 'path' => '/index.php/Retail/Store/statistics'],
|
|
['id' => 177, 'name' => '统计报表', 'path' => '/index.php/Retail/Statistics/index'],
|
|
['id' => 923, 'name' => '支付流水', 'path' => '/index.php/Retail/PayFlow/mIndex'],
|
|
['id' => 1178, 'name' => '串码查询', 'path' => '/index.php/Retail/Store/serial_number'],
|
|
['id' => 1191, 'name' => '商城DIY', 'path' => '/index.php/Retail/Diy/mer_index'],
|
|
]],
|
|
['id' => 184, 'name' => '商品', 'showList' => false, 'icon' => 'fa fa-bars', 'list' => [
|
|
['id' => 185, 'name' => '商品档案', 'path' => '/index.php/Retail/Mgoods/index'],
|
|
['id' => 196, 'name' => '商品分类', 'path' => '/index.php/Retail/MerCate/index'],
|
|
['id' => 1193, 'name' => '商品规格', 'path' => '/index.php/Retail/Attributes/mIndex'],
|
|
['id' => 200, 'name' => '商品导入', 'path' => '/index.php/Retail/Mgoodsimport/index'],
|
|
['id' => 205, 'name' => '商品云库', 'path' => '/index.php/Retail/GoodsCode/index'],
|
|
['id' => 978, 'name' => '商品回收站', 'path' => '/index.php/Retail/Mgoods/recycle'],
|
|
['id' => 1113, 'name' => '品牌库', 'path' => '/index.php/Retail/GoodsBrand/merchant_brand'],
|
|
['id' => 1158, 'name' => '商品标签', 'path' => '/index.php/Retail/LabelInventory/mer_index'],
|
|
['id' => 1168, 'name' => '商品单位', 'path' => '/index.php/Retail/UnitLibrary/mer_index'],
|
|
]],
|
|
['id' => 206, 'name' => '进销存', 'icon' => 'fa fa-truck', 'list' => [
|
|
['id' => 718, 'name' => '采购管理', 'list' => [
|
|
['id' => 719, 'name' => '采购单', 'path' => '/index.php/Retail/PurchaseOrder/index'],
|
|
['id' => 730, 'name' => '采购退货管理', 'path' => '/index.php/Retail/RetreatOrder/index'],
|
|
['id' => 737, 'name' => '采购商品明细', 'path' => '/index.php/Retail/PurchaseGoods/index'],
|
|
['id' => 208, 'name' => '供货商', 'path' => '/index.php/Retail/Supplier/index'],
|
|
['id' => 739, 'name' => '仓库管理', 'path' => '/index.php/Retail/PurchaseWarehouse/index'],
|
|
]],
|
|
['id' => 744, 'name' => '库存管理', 'showList' => false, 'icon' => 'fa fa-database', 'list' => [
|
|
['id' => 745, 'name' => '库存状况', 'path' => '/index.php/Retail/SaleMGoods/index'],
|
|
['id' => 755, 'name' => '盘点管理', 'path' => '/index.php/Retail/Inventory/index'],
|
|
['id' => 761, 'name' => '报损管理', 'path' => '/index.php/Retail/LossReport/index'],
|
|
['id' => 913, 'name' => '入库记录', 'path' => '/index.php/Retail/WarehouseRecord/index'],
|
|
['id' => 915, 'name' => '出库记录', 'path' => '/index.php/Retail/StockOutRecord/index'],
|
|
['id' => 768, 'name' => '供给仓库', 'path' => '/index.php/Retail/SaleWarehouse/index'],
|
|
]],
|
|
['id' => 772, 'name' => '货流管理', 'showList' => false, 'icon' => 'fa fa-truck', 'list' => [
|
|
['id' => 773, 'name' => '入库单', 'path' => '/index.php/Retail/WarehousingRecord/index'],
|
|
['id' => 784, 'name' => '出库单', 'path' => '/index.php/Retail/StockOutOrder/index'],
|
|
['id' => 896, 'name' => '申请调拨管理', 'path' => '/index.php/Retail/Transfer/index'],
|
|
['id' => 793, 'name' => '门店调拨管理', 'path' => '/index.php/Retail/AllocationTube/index'],
|
|
]],
|
|
['id' => 800, 'name' => '调价单管理', 'showList' => false, 'icon' => 'fa fa-truck', 'list' => [
|
|
['id' => 801, 'name' => '调价单', 'path' => '/index.php/Retail/ModifyPriceOrder/index'],
|
|
]],
|
|
]],
|
|
['id' => 935, 'name' => '资金', 'icon' => 'fa fa-krw', 'list' => [
|
|
['id' => 936, 'name' => '采购资金管理', 'list' => [
|
|
['id' => 937, 'name' => '采购应付款', 'path' => '/index.php/Retail/PurchasePayable/index'],
|
|
['id' => 940, 'name' => '采购资金流水', 'path' => '/index.php/Retail/PurchaseCapital/index'],
|
|
['id' => 957, 'name' => '退货应收款', 'path' => '/index.php/Retail/RetreatReceivables/index'],
|
|
['id' => 960, 'name' => '退货资金流水', 'path' => '/index.php/Retail/RetreatCapital/index'],
|
|
['id' => 942, 'name' => '预付款管理', 'path' => '/index.php/Retail/AdvancePayment/index'],
|
|
]],
|
|
// ['id' => 1046, 'name' => '加盟店结算管理', 'path' => '/index.php/Retail/FranchiseDeal/index'],
|
|
]],
|
|
['id' => 215, 'name' => '客户', 'showList' => false, 'icon' => 'fa fa-address-card', 'list' => [
|
|
['id' => 216, 'name' => '基础设置', 'list' => [
|
|
['id' => 217, 'name' => '积分规则', 'path' => '/index.php/Retail/Vipconfig/index'],
|
|
['id' => 1182, 'name' => '会员注册福利', 'path' => '/index.php/Retail/Vipconfig/welfare'],
|
|
['id' => 222, 'name' => '会员卡分享', 'path' => '/index.php/Retail/VipShare/index'],
|
|
['id' => 225, 'name' => '会员卡通知', 'path' => '/index.php/Retail/Card/cardNotice'],
|
|
['id' => 230, 'name' => '常规会员导入', 'path' => '/index.php/Retail/VipImport/index'],
|
|
]],
|
|
['id' => 235, 'name' => '会员卡设置', 'list' => [
|
|
['id' => 236, 'name' => '微信会员卡', 'path' => '/index.php/Retail/VipCard/index'],
|
|
['id' => 239, 'name' => '会员卡模板', 'path' => '/index.php/Retail/Card/template'],
|
|
['id' => 241, 'name' => '会员卡菜单', 'path' => '/index.php/Retail/VipCardMenuBar/index'],
|
|
]],
|
|
['id' => 243, 'name' => '普通用户', 'list' => [
|
|
['id' => 244, 'name' => '普通用户', 'path' => '/index.php/Retail/Vip/xcxvip'],
|
|
]],
|
|
['id' => 247, 'name' => '常规会员', 'list' => [
|
|
['id' => 248, 'name' => '常规会员', 'path' => '/index.php/Retail/Vip/index'],
|
|
['id' => 258, 'name' => '会员等级', 'path' => '/index.php/Retail/Vip/groups'],
|
|
]],
|
|
['id' => 261, 'name' => 'PLUS会员', 'list' => [
|
|
['id' => 262, 'name' => 'PLUS会员', 'path' => '/index.php/Retail/Plus/plusvip'],
|
|
['id' => 270, 'name' => 'PLUS会员设置', 'path' => '/index.php/Retail/Plus/index'],
|
|
['id' => 274, 'name' => 'PLUS会员管理', 'path' => '/index.php/Retail/Plus/administration'],
|
|
]],
|
|
['id' => 286, 'name' => '会员充值', 'list' => [
|
|
['id' => 287, 'name' => '会员充值', 'path' => '/index.php/Retail/VipBackstageRecharge/index'],
|
|
['id' => 288, 'name' => '充值管理', 'path' => '/index.php/Retail/Viprecharge/index'],
|
|
]],
|
|
['id' => 296, 'name' => '信息记录', 'list' => [
|
|
['id' => 297, 'name' => '余额记录', 'path' => '/index.php/Retail/Vipbalance/index'],
|
|
['id' => 299, 'name' => '充值记录', 'path' => '/index.php/Retail/Viprecharge/recharge'],
|
|
['id' => 301, 'name' => '变更记录', 'path' => '/index.php/Retail/Vip/editRecord'],
|
|
]],
|
|
['id' => 1061, 'name' => '会员营销', 'list' => [
|
|
['id' => 1062, 'name' => '会员转化', 'path' => '/index.php/Retail/Shipping/index'],
|
|
]],
|
|
]],
|
|
['id' => 303, 'name' => '设置', 'showList' => false, 'icon' => 'fa fa-gear', 'list' => [
|
|
['id' => 304, 'name' => '系统设置', 'showList' => false, 'icon' => 'fa fa-gear', 'list' => [
|
|
['id' => 305, 'name' => '公众号配置', 'path' => '/index.php/Retail/Wxconfig/wxconfig'],
|
|
['id' => 308, 'name' => '自定义菜单', 'path' => '/index.php/Retail/Wxconfig/menu'],
|
|
['id' => 309, 'name' => '公众号模板', 'path' => '/index.php/Retail/Mark/index'],
|
|
$mini_state == 2 ? ['id' => 314, 'name' => '小程序授权', 'path' => '/index.php/Retail/XcxConfig/wxconfig'] : '',
|
|
$mini_state == 2 ? ['id' => 930, 'name' => '小程序模板', 'path' => '/index.php/Retail/XcxMark/index'] : '',
|
|
$mini_state == 2 ? ['id' => 318, 'name' => '小程序设置', 'path' => '/index.php/Retail/XcxConfig/setNearby'] : '',
|
|
]],
|
|
['id' => 321, 'name' => '支付设置', 'list' => [
|
|
['id' => 322, 'name' => '支付设置', 'path' => '/index.php/Retail/Payset/paySet'],
|
|
['id' => 1090, 'name' => '打款设置', 'path' => '/index.php/Retail/Payset/remit'],
|
|
['id' => 324, 'name' => '基本设置', 'path' => '/index.php/Retail/BaseSet/index'],
|
|
]],
|
|
['id' => 1300, 'name' => '骑手管理', 'list' => [
|
|
['id' => 1301, 'name' => '骑手列表', 'path' => '/index.php/Retail/Rider/index'],
|
|
['id' => 1302, 'name' => '订单管理', 'path' => '/index.php/Retail/RiderOrder/index'],
|
|
['id' => 1304, 'name' => '提现管理', 'path' => '/index.php/Retail/RiderWithdraw/index'],
|
|
// ['id' => 1303, 'name' => '配送统计', 'path' => '/index.php/Retail/RiderStats/index'],
|
|
// ['id' => 1306, 'name' => '奖励活动', 'path' => '/index.php/Retail/RiderReward/index'],
|
|
// ['id' => 1307, 'name' => '申诉处理', 'path' => '/index.php/Retail/RiderAppeal/index'],
|
|
// ['id' => 1308, 'name' => '考核管理', 'path' => '/index.php/Retail/RiderAssessment/index'],
|
|
// ['id' => 1309, 'name' => '区域管理', 'path' => '/index.php/Retail/RiderArea/index'],
|
|
// ['id' => 1310, 'name' => '系统消息', 'path' => '/index.php/Retail/RiderMessage/index'],
|
|
// ['id' => 1311, 'name' => '状态监控', 'path' => '/index.php/Retail/RiderMonitor/index'],
|
|
['id' => 1312, 'name' => '系统配置', 'path' => '/index.php/Retail/Rider/config'],
|
|
]],
|
|
// ['id' => 331, 'name' => '配送', 'showList' => false, 'icon' => 'fa fa-motorcycle', 'list' => [
|
|
// ['id' => 332, 'name' => '达达商户', 'path' => '/index.php/Retail/Delivery/configure'],
|
|
// ['id' => 336, 'name' => '达达配送记录', 'path' => '/index.php/Retail/Delivery/deliveryrecord'],
|
|
// ['id' => 338, 'name' => 'UU跑腿', 'path' => '/index.php/Retail/Uuerrands/index'],
|
|
// ['id' => 342, 'name' => 'UU跑腿记录', 'path' => '/index.php/Retail/Uuerrands/deliveryrecord_uu'],
|
|
// ]],
|
|
['id' => 344, 'name' => '常规设置', 'list' => [
|
|
['id' => 345, 'name' => '短信设置', 'path' => '/index.php/Retail/Sms/index'],
|
|
['id' => 348, 'name' => '公告', 'path' => '/index.php/Retail/Notice/index'],
|
|
['id' => 353, 'name' => '图片管理', 'path' => '/index.php/Retail/MerchantImage/index'],
|
|
['id' => 1127, 'name' => '基本设置', 'path' => '/index.php/Retail/MerInventoryPrint/index'],
|
|
]],
|
|
['id' => 357, 'name' => '角色', 'showList' => false, 'icon' => 'fa fa-user-circle-o', 'list' => [
|
|
['id' => 358, 'name' => '店长', 'path' => '/index.php/Retail/Manager/manager'],
|
|
['id' => 362, 'name' => '用户列表', 'path' => '/index.php/Retail/MerchantJurUsers/index'],
|
|
['id' => 366, 'name' => '角色管理', 'path' => '/index.php/Retail/MerchantRoles/index'],
|
|
]],
|
|
['id' => 370, 'name' => '插件', 'showList' => false, 'icon' => 'fa fa-cogs', 'path' => '/index.php/Retail/Plug/index'],
|
|
]],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* 门店菜单栏
|
|
* @param bool $root 是否直接读取所有菜单 true是 false不是(根据权限判断)
|
|
* @return array
|
|
*/
|
|
private function getStoreMenu($root = false)
|
|
{
|
|
if ($root) {
|
|
$store = [
|
|
'supplier_type' => 1,
|
|
'store_class' => 2,
|
|
];
|
|
$credit = true;
|
|
$vipCoupon = true;
|
|
$open_distribution = ['is_open' => 1];
|
|
$mini_state = 2;
|
|
$plug_info = [
|
|
'group' => 1,
|
|
'seckill' => 1,
|
|
'presale' => 1,
|
|
'blessing' => 1,
|
|
];
|
|
$store_power = [
|
|
'store_xcx_distribution_fee' => 1,
|
|
'purchase' => 1,
|
|
'capital' => 1,
|
|
'home_diy' => 1,
|
|
];
|
|
} else {
|
|
$StoreModel = new \Common\Model\StoreModel();
|
|
$StoreAuthModel = new RetailStoreAuthModel();
|
|
$MerchantModel = new RetailMerchantModel();
|
|
|
|
//门店类型 1直营 2加盟
|
|
$store = $StoreModel->getFind(['id' => $this->store_id], 'store_class,supplier_type');
|
|
|
|
//实例化插件类
|
|
$PlugApi = new \Common\Business\Plug();
|
|
//获取付费插件列表及状态
|
|
$result = $PlugApi->PlugPermissions([
|
|
'merchant_id' => $this->merchant_id,
|
|
'identification_arr' => ['credit', 'malldistribution', 'vipcoupon']
|
|
]);
|
|
$credit = false;//赊账
|
|
$distribution = false;//分销
|
|
$vipCoupon = false;//会员优惠券
|
|
if ($result['status'] == 1) {
|
|
if ($result['data']['plug']['credit']) $credit = true;
|
|
if ($result['data']['plug']['malldistribution']) $distribution = true;
|
|
if ($result['data']['plug']['vipcoupon']) $vipCoupon = true;
|
|
}
|
|
//商户是否开启分销
|
|
if ($distribution) {
|
|
$open_distribution = ['merchant_id' => $this->merchant_id];
|
|
\Think\Hook::listen('open_distribution', $open_distribution);
|
|
}
|
|
|
|
//商户商城权限
|
|
$mini_state = $MerchantModel->getFindField(['id' => $this->merchant_id], 'juris');
|
|
//拼团、秒杀、预售权限
|
|
$RetailPlugModel = new \Common\Model\RetailPlugModel();
|
|
$plug_info = $RetailPlugModel->plug_store_verify(["store_id" => $this->store_id, "identification" => ['group', 'seckill', 'presale', 'blessing']]);
|
|
//门店权限
|
|
$store_power = $StoreAuthModel->getFind(['storeid' => $this->store_id], "purchase,capital,store_xcx_distribution_fee,home_diy");
|
|
}
|
|
|
|
return [
|
|
['id' => 427, 'name' => '概况', 'icon' => 'fa fa-home', 'path' => '/index.php/Retail/Home/index'],
|
|
['id' => 428, 'name' => '商品', 'icon' => 'fa fa-bars', 'list' => [
|
|
['id' => 429, 'name' => '商品档案', 'path' => '/index.php/Retail/Goods/goods'],
|
|
['id' => 450, 'name' => '商品分类', 'path' => '/index.php/Retail/Goods/goods_cate'],
|
|
['id' => 452, 'name' => '分单标签', 'path' => '/index.php/Retail/GoodsLabel/index'],
|
|
['id' => 456, 'name' => '商品规格', 'path' => '/index.php/Retail/Attributes/sIndex'],
|
|
['id' => 1075, 'name' => '商品导入', 'path' => '/index.php/Retail/Goods/goods_import'],
|
|
['id' => 459, 'name' => '拆分组合', 'path' => '/index.php/Retail/Goods/splitgoods'],
|
|
['id' => 462, 'name' => '临期预警', 'path' => '/index.php/Retail/Past/index'],
|
|
['id' => 464, 'name' => '商城商品', 'path' => '/index.php/Retail/Goods/xcxgoods'],
|
|
['id' => 1053, 'name' => '赠品库', 'path' => '/index.php/Retail/GoodsGifts/index'],
|
|
['id' => 975, 'name' => '商品回收站', 'path' => '/index.php/Retail/Goods/recycle'],
|
|
['id' => 1114, 'name' => '品牌库', 'path' => '/index.php/Retail/GoodsBrand/store_brand'],
|
|
['id' => 1163, 'name' => '商品标签', 'path' => '/index.php/Retail/LabelInventory/store_index'],
|
|
['id' => 1171, 'name' => '商品单位', 'path' => '/index.php/Retail/UnitLibrary/store_index'],
|
|
]],
|
|
$mini_state == 2 ? ['id' => 465, 'name' => '商城', 'icon' => 'fa fa-shopping-bag', 'list' => [
|
|
['id' => 466, 'name' => '门店图片', 'path' => '/index.php/Retail/Xcx/banner'],
|
|
['id' => 471, 'name' => '门店设置', 'path' => '/index.php/Retail/Xcx/manager'],
|
|
['id' => 472, 'name' => '同城配送费', 'path' => '/index.php/Retail/Xcx/distribution'],
|
|
['id' => 475, 'name' => '分类导航', 'path' => '/index.php/Retail/Xcx/navigation'],
|
|
['id' => 479, 'name' => '智慧魔方', 'path' => '/index.php/Retail/Xcx/magic_cube'],
|
|
['id' => 999, 'name' => '商城地址库', 'path' => '/index.php/Retail/XcxRoute/index'],
|
|
['id' => 1050, 'name' => '商品评价', 'path' => '/index.php/Retail/OrderEvaluate/index'],
|
|
$store_power['home_diy'] == 1 ? ['id' => 1120, 'name' => 'DIY设置', 'path' => '/index.php/Retail/Diy/index'] : '',
|
|
]] : '',
|
|
$mini_state == 2 ? ['id' => 484, 'name' => '营销', 'icon' => 'fa fa-gift', 'list' => [
|
|
['id' => 485, 'name' => '推荐商品', 'path' => '/index.php/Retail/Xcx/hot'],
|
|
['id' => 490, 'name' => '促销商品', 'path' => '/index.php/Retail/Xcx/promotion'],
|
|
['id' => 495, 'name' => '最新商品', 'path' => '/index.php/Retail/Xcx/new_goods'],
|
|
$plug_info['group'] ? ['id' => 499, 'name' => '多人拼团', 'path' => '/index.php/Retail/Group/index'] : '',
|
|
$plug_info['seckill'] ? ['id' => 508, 'name' => '秒杀', 'path' => '/index.php/Retail/SecKill/index'] : '',
|
|
$plug_info['presale'] ? ['id' => 985, 'name' => '预售', 'path' => '/index.php/Retail/AdvanceSale/index'] : '',
|
|
['id' => 518, 'name' => '普通优惠券', 'path' => '/index.php/Retail/Coupon/coupons'],
|
|
$vipCoupon ? ['id' => 1139, 'name' => '会员优惠券', 'path' => '/index.php/Retail/StoreCoupon/index'] : '',
|
|
$open_distribution['is_open'] == 1 ? ['id' => 1155, 'name' => '分销商品', 'path' => '/index.php/Distribution/BackstageStore/store_goods'] : '',
|
|
$plug_info['blessing'] ? ['id' => 1184, 'name' => '送祝福', 'path' => '/index.php/Blessing/Blessing/index'] : '',
|
|
]] : '',
|
|
['id' => 523, 'name' => '经营', 'icon' => 'fa fa-bar-chart', 'list' => [
|
|
['id' => 524, 'name' => '店内收款明细', 'path' => '/index.php/Retail/Sale/recebles'],
|
|
['id' => 530, 'name' => '商城订单明细', 'path' => '/index.php/Retail/Xcx/order'],
|
|
['id' => 535, 'name' => '商品销售明细', 'path' => '/index.php/Retail/Sale/particulars'],
|
|
['id' => 537, 'name' => '商品销售汇总', 'path' => '/index.php/Retail/Sale/saleDetails'],
|
|
['id' => 539, 'name' => '滞销商品', 'path' => '/index.php/Retail/Sale/deadStock'],
|
|
['id' => 541, 'name' => '畅销商品', 'path' => '/index.php/Retail/Sale/salable'],
|
|
['id' => 543, 'name' => '销售统计', 'path' => '/index.php/Retail/Home/statistics'],
|
|
['id' => 545, 'name' => '销售报表', 'path' => '/index.php/Retail/ReportTable/sell_order'],
|
|
['id' => 546, 'name' => '会员消费结算', 'path' => '/index.php/Retail/Sale/vip_user'],
|
|
$credit ? ['id' => 1150, 'name' => '赊账流水', 'path' => '/index.php/Credit/StoreCredit/stream'] : '',
|
|
]],
|
|
['id' => 548, 'name' => '订单', 'icon' => 'fa fa-list', 'list' => [
|
|
['id' => 549, 'name' => '商城订单', 'list' => [
|
|
['id' => 550, 'name' => '常规订单', 'path' => '/index.php/Retail/Xcx/order'],
|
|
]],
|
|
['id' => 555, 'name' => '活动订单', 'list' => [
|
|
$plug_info['group'] ? ['id' => 556, 'name' => '拼团订单', 'path' => '/index.php/Retail/Group/orderindex'] : '',
|
|
$plug_info['seckill'] ? ['id' => 563, 'name' => '秒杀订单', 'path' => '/index.php/Retail/SecKill/order'] : '',
|
|
$plug_info['presale'] ? ['id' => 1041, 'name' => '预售订单', 'path' => '/index.php/Retail/AdvanceOrder/index'] : '',
|
|
]],
|
|
['id' => 1011, 'name' => '售后订单', 'list' => [
|
|
['id' => 1012, 'name' => '线上订单', 'path' => '/index.php/Retail/Customer/index'],
|
|
// ['id' => 1185, 'name' => '线下订单', 'path' => '/index.php/Retail/Customer/line_index'],
|
|
]],
|
|
// ['id' => 570, 'name' => '外送订单', 'list' => [
|
|
// ['id' => 571, 'name' => '达达订单', 'path' => '/index.php/Retail/Delivery/storerecord'],
|
|
// ['id' => 573, 'name' => 'UU订单', 'path' => '/index.php/Retail/Uuerrands/storerecord'],
|
|
// ['id' => 1103, 'name' => '码科订单', 'path' => '/index.php/Retail/Make/index'],
|
|
// ['id' => 1208, 'name' => '麦芽田订单', 'path' => '/index.php/Retail/Maiyatian/index'],
|
|
// ]],
|
|
['id' => 575, 'name' => '评价信息', 'path' => '/index.php/Retail/Comment/comment'],
|
|
['id' => 925, 'name' => '支付流水', 'path' => '/index.php/Retail/PayFlow/sIndex'],
|
|
['id' => 576, 'name' => '开票信息', 'path' => '/index.php/Retail/Comment/comment'],
|
|
]],
|
|
['id' => 578, 'name' => '客户', 'icon' => 'fa fa-address-card', 'list' => [
|
|
['id' => 579, 'name' => '普通用户', 'path' => '/index.php/Retail/Vips/xcxvip'],
|
|
['id' => 582, 'name' => '常规会员', 'path' => '/index.php/Retail/Vips/index'],
|
|
['id' => 588, 'name' => 'PLUS会员', 'path' => '/index.php/Retail/Plus/store_plusvip'],
|
|
$credit ? ['id' => 1122, 'name' => '赊账用户', 'path' => '/index.php/Credit/StoreCredit/index'] : '',
|
|
['id' => 596, 'name' => '余额记录', 'path' => '/index.php/Retail/Vipsbalance/index'],
|
|
['id' => 598, 'name' => '充值记录', 'path' => '/index.php/Retail/Vipsbalance/recharge'],
|
|
['id' => 1151, 'name' => '会员分析', 'path' => '/index.php/Retail/MemberAnalyze/analysis'],
|
|
['id' => 1152, 'name' => '会员统计', 'path' => '/index.php/Retail/MemberAnalyze/vip_acount'],
|
|
['id' => 1153, 'name' => '会员标签', 'path' => '/index.php/Retail/MemberAnalyze/vip_label'],
|
|
['id' => 601, 'name' => '变更记录', 'path' => '/index.php/Retail/Vips/editRecord'],
|
|
]],
|
|
['id' => 808, 'name' => '进销存', 'icon' => 'fa fa-truck', 'list' => [
|
|
$store_power['purchase'] == 1 ? ['id' => 809, 'name' => '采购管理', 'list' => [
|
|
['id' => 810, 'name' => '采购单', 'path' => '/index.php/Retail/SPurchaseOrder/index'],
|
|
['id' => 820, 'name' => '采购退货管理', 'path' => '/index.php/Retail/SRetreatOrder/index'],
|
|
['id' => 827, 'name' => '采购商品明细', 'path' => '/index.php/Retail/SPurchaseGoods/index'],
|
|
['id' => 829, 'name' => '仓库管理', 'path' => '/index.php/Retail/SPurchaseWarehouse/index'],
|
|
['id' => 834, 'name' => '供应商', 'path' => '/index.php/Retail/SSupplier/index'],
|
|
]] : '',
|
|
['id' => 839, 'name' => '库存管理', 'icon' => 'fa fa-database', 'list' => [
|
|
['id' => 840, 'name' => '库存状况', 'path' => '/index.php/Retail/SSaleMGoods/index'],
|
|
['id' => 849, 'name' => '盘点管理', 'path' => '/index.php/Retail/SInventory/index'],
|
|
['id' => 856, 'name' => '报损管理', 'path' => '/index.php/Retail/SLossReport/index'],
|
|
['id' => 917, 'name' => '入库记录', 'path' => '/index.php/Retail/SWarehouseRecord/index'],
|
|
['id' => 919, 'name' => '出库记录', 'path' => '/index.php/Retail/SStockOutRecord/index'],
|
|
['id' => 619, 'name' => '库存报表', 'path' => '/index.php/Retail/ReportTable/stocks'],
|
|
['id' => 863, 'name' => '供给仓库', 'path' => '/index.php/Retail/SSaleWarehouse/index'],
|
|
]],
|
|
['id' => 867, 'name' => '货流管理', 'list' => [
|
|
['id' => 868, 'name' => '入库单', 'path' => '/index.php/Retail/SWarehousingRecord/index'],
|
|
$store['supplier_type'] == 1 ? ['id' => 879, 'name' => '出库单', 'path' => '/index.php/Retail/SStockOutOrder/index'] : '',
|
|
$store['supplier_type'] == 1 ? ['id' => 902, 'name' => '调拨单', 'path' => '/index.php/Retail/AllocationApply/index'] : '',
|
|
]],
|
|
['id' => 888, 'name' => '调价单管理', 'showList' => false, 'icon' => 'fa fa-truck', 'list' => [
|
|
['id' => 889, 'name' => '调价单', 'path' => '/index.php/Retail/SModifyPriceOrder/index'],
|
|
]],
|
|
]],
|
|
['id' => 945, 'name' => '资金', 'icon' => 'fa fa-krw', 'list' => [
|
|
$store_power['capital'] == 1 ? ['id' => 946, 'name' => '采购资金管理', 'list' => [
|
|
['id' => 947, 'name' => '采购应付款', 'path' => '/index.php/Retail/SPurchasePayable/index'],
|
|
['id' => 950, 'name' => '采购资金流水', 'path' => '/index.php/Retail/SPurchaseCapital/index'],
|
|
['id' => 962, 'name' => '退货应收款', 'path' => '/index.php/Retail/SRetreatReceivables/index'],
|
|
['id' => 965, 'name' => '退货资金流水', 'path' => '/index.php/Retail/SRetreatCapital/index'],
|
|
['id' => 952, 'name' => '预付款管理', 'path' => '/index.php/Retail/SAdvancePayment/index'],
|
|
]] : '',
|
|
$store['store_class'] == 2 ? ['id' => 1048, 'name' => '收入管理', 'path' => '/index.php/Retail/FranchiseDeal/indexMoney'] : '',
|
|
]],
|
|
['id' => 652, 'name' => '设备', 'icon' => 'fa fa-print', 'list' => [
|
|
['id' => 653, 'name' => '打印机', 'path' => '/index.php/Retail/Printer/index'],
|
|
// ['id' => 660, 'name' => '收银机', 'path' => '/index.php/Retail/Checkstand/index'],
|
|
// ['id' => 982, 'name' => '刷脸设备', 'path' => '/index.php/Retail/FaceClient/index']
|
|
]],
|
|
['id' => 663, 'name' => '设置', 'icon' => 'fa fa-cog', 'list' => [
|
|
['id' => 321, 'name' => '支付设置', 'list' => [
|
|
['id' => 322, 'name' => '支付设置', 'path' => '/index.php/Retail/Payset/paySet'],
|
|
['id' => 1090, 'name' => '打款设置', 'path' => '/index.php/Retail/Payset/remit'],
|
|
['id' => 324, 'name' => '基本设置', 'path' => '/index.php/Retail/BaseSet/index'],
|
|
]],
|
|
$credit ? ['id' => 1121, 'name' => '赊账设置', 'path' => '/index.php/Credit/StoreCredit/creditSet'] : '',
|
|
['id' => 991, 'name' => '电子面单', 'list' => [
|
|
['id' => 997, 'name' => '面单列表', 'showList' => false, 'path' => '/index.php/Retail/Express/order'],
|
|
['id' => 992, 'name' => '设置', 'showList' => false, 'path' => '/index.php/Retail/Express/set'],
|
|
]],
|
|
['id' => 664, 'name' => '小票设置', 'path' => '/index.php/Retail/Receipt/index'],
|
|
['id' => 667, 'name' => '价牌打印', 'path' => '/index.php/Retail/PriceTag/createPriceTag'],
|
|
['id' => 668, 'name' => '基本设置', 'path' => '/index.php/Retail/StoreSet/baseSet'],
|
|
['id' => 680, 'name' => '图片管理', 'path' => '/index.php/Retail/StoreImage/index'],
|
|
['id' => 1154, 'name' => '配送模板设置', 'path' => '/index.php/Retail/SystemDelivery/distributionTemplate'], //xc添加
|
|
['id' => 683, 'name' => '角色', 'icon' => 'fa fa-user', 'list' => [
|
|
// ['id' => 684, 'name' => '收银员', 'path' => '/index.php/Retail/Cashier/index'],
|
|
// ['id' => 693, 'name' => '导购员', 'path' => '/index.php/Retail/Guide/index'],
|
|
// ['id' => 701, 'name' => '导购结算', 'path' => '/index.php/Retail/Guide/takeindex'],
|
|
['id' => 705, 'name' => '用户列表', 'path' => '/index.php/Retail/StoreJurUsers/index'],
|
|
['id' => 709, 'name' => '角色管理', 'path' => '/index.php/Retail/StoreRoles/index'],
|
|
]],
|
|
]],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* 导购员菜单栏
|
|
* @return array
|
|
*/
|
|
private function getGuideMenu()
|
|
{
|
|
return [
|
|
['id' => 713, 'name' => '首页', 'icon' => 'fa fa-home', 'path' => '/index.php/Retail/AloneGuide/home'],
|
|
['id' => 715, 'name' => '记录', 'icon' => 'fa fa-list', 'path' => '/index.php/Retail/AloneGuide/record'],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* 更新菜单栏排序
|
|
*/
|
|
public function updateMenuSort()
|
|
{
|
|
$this->updateSort($this->getPartnerMenu());
|
|
$this->updateSort($this->getAgentMenu());
|
|
$this->updateSort($this->getMerchantMenu(1));
|
|
$this->updateSort($this->getStoreMenu(1));
|
|
$this->updateSort($this->getGuideMenu());
|
|
}
|
|
|
|
/**
|
|
* 更新菜单栏排序
|
|
* @param $list
|
|
*/
|
|
private function updateSort($list)
|
|
{
|
|
$sort = 1;
|
|
$JurListMode = new JurisdictionListModel();
|
|
foreach ($list as $value) {
|
|
$JurListMode->updateOrder(['id' => $value['id']], ['sort' => $sort, 'is_menu' => 1]);
|
|
$sort++;
|
|
if (!empty($value['list'])) {
|
|
$this->updateSort($value['list']);
|
|
}
|
|
}
|
|
}
|
|
|
|
} |