|
- <?php
- namespace backend\controllers;
-
- use common\models\User;
- use Yii;
- use yii\web\Controller;
- use backend\modules\zzcs\models\BaseUser;
-
- class MenuController extends Controller
- {
- public $enableCsrfValidation = false;
- public $layout = '@backend/views/layouts/menu.php';
-
- /**
- * Function Description:获取菜单
- * Function Name: actionIndex
- *
- * @return string
- *
- * @author Redstop
- */
- public function actionIndex()
- {
- $base_url = "http://". CS_DOMAIN;
- $base_url1 = "http://". CS1_DOMAIN;
- $base_url2 = "http://fx.". DOMAIN;
- // $base_url = "http://sandbox.zhizhuchuxing.com";
- // $base_url1 = "http://sandbox1.zhizhuchuxing.com";
-
- $request = Yii::$app->request;
- $user_id = $request->post("user_id");//需要更新的bus_id
- $model_user = new BaseUser();
- $user_info = $model_user->getUserInfo($user_id);
- $user_role_id = $user_info[0]["USER_ROLE"];
- $main_corp_id = $user_info[0]["MAIN_CORP_ID"];
- if( $main_corp_id == 4 ) {
- $base_url2 = "http://qdhfx.". DOMAIN;
- }
-
- $json = array();
- $json["code"] = "0";
- $menu_array = array();
- $menu_info = array();
- if (in_array($user_role_id, array(0, 1, 2, 3, 8, 12, 13, 15, 16))) {
- $menu_info["main"] = " 基础信息配置管理 ";
- $menu_info["sub"] = array();
- if (in_array($user_role_id, array(0, 1, 2, 8, 13, 15,16))) {
- $menu_info["sub"][] = array("menu_name" => "站点/区域管理", "menu_url" => $base_url1 . "/zzcs/station/list");
- $menu_info["sub"][] = array("menu_name" => "站点/区域审核", "menu_url" => $base_url1 . "/zzcs/station/audit-list");
- }
- if (in_array($user_role_id, array(0, 3, 12, 13))) {
- $menu_info["sub"][] = array("menu_name" => "酒店基础信息管理", "menu_url" => $base_url . "/zz-jd/hotel_list.html");
- }
- if (in_array($user_role_id, array(0, 1, 3, 8, 13,16))) {
- $menu_info["sub"][] = array("menu_name" => "供应商管理", "menu_url" => $base_url . "/supplier_list.html");
- }
- if (in_array($user_role_id, array(0))) {
- $menu_info["sub"][] = array("menu_name" => "渠道商管理", "menu_url" => $base_url . "/channel_list.html");
- }
- $menu_array[] = $menu_info;
- }
-
- if (in_array($user_role_id, array(0, 1, 2, 3, 8, 9, 12, 13, 15,16))) {
- $menu_info["main"] = " 产品管理 ";
- $menu_info["sub"] = array();
- if (in_array($user_role_id, array(0, 1, 2, 8, 9, 13, 15,16))) {
- $menu_info["sub"][] = array("menu_name" => "巴士线路管理", "menu_url" => $base_url . "/web/lineManager/line_list.html");
- }
- if (in_array($user_role_id, array(0, 1, 2, 3, 8, 9, 12, 13, 15))) {
- $menu_info["sub"][] = array("menu_name" => "门票产品管理", "menu_url" => $base_url1 . "/zzcs/prod/prod-list");
- }
- if (in_array($user_role_id, array(0, 3, 12, 13))) {
- $menu_info["sub"][] = array("menu_name" => "酒店上下架管理", "menu_url" => $base_url . "/zz-jd/up_down_control.html");
- }
- $menu_array[] = $menu_info;
- }
-
- if (in_array($user_role_id, array(0, 1, 2, 3, 8, 12, 13, 15,16))) {
- $menu_info["main"] = " 库存管理 ";
- $menu_info["sub"] = array();
- if (in_array($user_role_id, array(0, 3, 12, 13))) {
- // $menu_info["sub"][] = array("menu_name" => "酒店房态管理", "menu_url" => $base_url . "/zz-jd/hotel_product_list.html");
- $menu_info["sub"][] = array("menu_name" => "酒店房态管理", "menu_url" => $base_url . "/zz-jd/hotel_product_list.html");
- }
- if (in_array($user_role_id, array(0, 1, 2, 8, 13, 15,16))) {
- $menu_info["sub"][] = array("menu_name" => "巴士车次管理", "menu_url" => $base_url . "/carList.html");
- }
- if (in_array($user_role_id, array(0, 1, 2, 3, 8, 12, 13, 15,16))) {
- $menu_info["sub"][] = array("menu_name" => "巴士成本管理", "menu_url" => $base_url1 . "/zzcs/line/cost-list");
- }
- $menu_array[] = $menu_info;
- }
-
- if (in_array($user_role_id, array(0, 1, 2, 3, 5, 8, 12, 13, 15,16))) {
- $menu_info["main"] = " 录单管理 ";
- $menu_info["sub"] = array();
- if (in_array($user_role_id, array(0, 1, 2, 5, 8, 12, 13, 15,16))) {
- $menu_info["sub"][] = array("menu_name" => "巴士订单录入", "menu_url" => $base_url . "/web/orderManager/select_product.html");
- }
- if (in_array($user_role_id, array(0, 1, 5, 12, 13))) {
- if( $main_corp_id == 0 ) {
- $menu_info["sub"][] = array("menu_name" => "门票订单录入", "menu_url" => $base_url . "/special_ticket.html");
- } else {
- $menu_info["sub"][] = array("menu_name" => "门票订单录入", "menu_url" => $base_url1 . "/zzcs/prod/fill-order");//test
- }
- }
- if (in_array($user_role_id, array(0, 3, 5, 12, 13))) {
- $menu_info["sub"][] = array("menu_name" => "酒店订单录入", "menu_url" => $base_url . "/zz-jd/choose_product.html");
- }
- if (in_array($user_role_id, array(0))) {
- $menu_info["sub"][] = array("menu_name" => "定制巴士订单录入", "menu_url" => $base_url1 . "/motorcade/zizai/create");
- }
- /*
- if (in_array($user_role_id, array(0))) {
- $menu_info["sub"][] = array("menu_name" => "组合线路订单补录", "menu_url" => $base_url . "/web/orderManager/resub_order.html");
- }
- */
- $menu_array[] = $menu_info;
- }
-
- if (in_array($user_role_id, array(0, 1, 2, 3, 4, 5, 8, 9, 11, 12, 13, 15,16))) {
- $menu_info["main"] = " 订单管理 ";
- $menu_info["sub"] = array();
- if (in_array($user_role_id, array(0, 1, 2, 3, 4, 5, 8, 9, 12, 13, 15,16))) {
- $menu_info["sub"][] = array("menu_name" => "巴士订单列表", "menu_url" => $base_url . "/order_list.html");
- }
- /*
- if (in_array($user_role_id, array(0))) {
- $menu_info["sub"][] = array("menu_name" => "组合线路订单列表", "menu_url" => $base_url . "/web/orderManager/order_list.html");
- }
- */
- if (in_array($user_role_id, array(0, 1, 3, 4, 5, 12, 13))) {
- $menu_info["sub"][] = array("menu_name" => "门票订单列表", "menu_url" => $base_url . "/des_order_list.html");
- }
- if (in_array($user_role_id, array(0, 3, 4, 5, 12, 13))) {
- $menu_info["sub"][] = array("menu_name" => "酒店订单列表", "menu_url" => $base_url . "/zz-jd/hotel_order_list.html");
- // $menu_info["sub"][] = array("menu_name" => "酒店历史订单列表", "menu_url" => $base_url . "/zz-jd/zwy_hotel_order_list.html");
- }
- if (in_array($user_role_id, array(11))) {
- $menu_info["sub"][] = array("menu_name" => "酒店订单列表", "menu_url" => $base_url . "/zz-jd/outside_hotel_order_list.html");
- }
- if (in_array($user_role_id, array(0))) {
- $menu_info["sub"][] = array("menu_name" => "定制巴士订单列表", "menu_url" => $base_url1 . "/motorcade/zizai");
- }
- $menu_array[] = $menu_info;
- }
-
- if (in_array($user_role_id, array(0, 1, 2, 8, 9, 13, 15,16))) {
- $menu_info["main"] = " 车队运营管理 ";
- $menu_info["sub"] = array();
- if (in_array($user_role_id, array(0, 1, 2, 8, 9, 13, 15,16))) {
- $menu_info["sub"][] = array("menu_name" => "车辆司机管理", "menu_url" => $base_url1 . "/zzcs/car/list");
- /*
- $menu_info["sub"][] = array("menu_name" => "车型基础信息配置", "menu_url" => $base_url1 . "/zzcs/base/brand-list");
- $menu_info["sub"][] = array("menu_name" => "车辆管理", "menu_url" => $base_url1 . "/zzcs/car/list");
- $menu_info["sub"][] = array("menu_name" => "司机管理", "menu_url" => $base_url1 . "/zzcs/driver/list");
- */
- $menu_info["sub"][] = array("menu_name" => "车辆调度", "menu_url" => $base_url . "/branchmoney.html");
- }
- /*
- if (in_array($user_role_id, array(0))) {
- $menu_info["sub"][] = array("menu_name" => "组合线路车辆调度", "menu_url" => $base_url . "/web/vehiclesDispatch/single_dispatch.html");
- }
- */
- $menu_array[] = $menu_info;
- }
- if (in_array($user_role_id, array( 0, 1, 4, 13 ))) {
- $menu_info["main"] = " 分销管理 ";
- $menu_info["sub"] = array();
- if (in_array($user_role_id, array(0, 1, 13))) {
- $menu_info["sub"][] = array("menu_name" => "产品管理", "menu_url" => $base_url2 . "/web/admin/product_list.html");
- $menu_info["sub"][] = array("menu_name" => "订单管理", "menu_url" => $base_url2 . "/web/admin/order_list.html");
- }
- if (in_array($user_role_id, array(0, 1, 4, 13))) {
- $menu_info["sub"][] = array("menu_name" => "分销商列表", "menu_url" => $base_url2 . "/web/admin/distributor_list.html");
- $menu_info["sub"][] = array("menu_name" => "提现申请列表", "menu_url" => $base_url2 . "/web/admin/withdrawal_list.html");
- }
- $menu_array[] = $menu_info;
- }
-
-
- if (in_array($user_role_id, array(0, 1, 2, 3, 4, 5, 8, 12, 13, 15,16))) {
- $menu_info["main"] = " 统计报表 ";
- $menu_info["sub"] = array();
- if (in_array($user_role_id, array(0, 1, 2, 4, 5, 8, 12, 13, 15))) {
- $menu_info["sub"][] = array("menu_name" => "巴士业绩统计(含成本)", "menu_url" => $base_url1 . "/zzcs/finance/bus-cost-form");
- }
- if (in_array($user_role_id, array(0, 1, 2, 4, 5, 8, 12, 13, 15,16))) {
- $menu_info["sub"][] = array("menu_name" => "巴士业绩统计", "menu_url" => $base_url1 . "/zzcs/order/order-statistical-form");
- }
- if (in_array($user_role_id, array(0, 3, 4, 12, 13, 15))) {
- $menu_info["sub"][] = array("menu_name" => "酒店销售统计", "menu_url" => $base_url1 . "/hotel/report/sales");
- $menu_info["sub"][] = array("menu_name" => "酒店渠道统计", "menu_url" => $base_url1 . "/hotel/report/sale-channel");
- $menu_info["sub"][] = array("menu_name" => "酒店客服业绩统计", "menu_url" => $base_url1 . "/hotel/report/customer");
- $menu_info["sub"][] = array("menu_name" => "酒店采购业绩统计", "menu_url" => $base_url1 . "/hotel/report/purchase");
- }
- $menu_array[] = $menu_info;
- }
-
- ///////////////////////////////////////////////////
- // 厦门 6,7,10,14 //
- ///////////////////////////////////////////////////
- if (in_array($user_role_id, array(6, 14))) {
- $menu_info["main"] = " 产品管理 ";
- $menu_info["sub"] = array();
- if (in_array($user_role_id, array(6))) {
- $menu_info["sub"][] = array("menu_name" => "车辆管理", "menu_url" => $base_url . "/web/busManager/carList.html");
- }
- if (in_array($user_role_id, array(6))) {
- $menu_info["sub"][] = array("menu_name" => "线路管理", "menu_url" => $base_url . "/web/lineManager/line_list.html");
- }
- if (in_array($user_role_id, array(6, 14))) {
- $menu_info["sub"][] = array("menu_name" => "车辆调度", "menu_url" => $base_url . "/web/vehiclesDispatch/single_dispatch.html");
- }
- $menu_array[] = $menu_info;
- }
-
- if (in_array($user_role_id, array(6, 7, 10, 14))) {
- $menu_info["main"] = " 订单管理 ";
- $menu_info["sub"] = array();
- if (in_array($user_role_id, array(6, 7, 14))) {
- $menu_info["sub"][] = array("menu_name" => "录入订单", "menu_url" => $base_url . "/web/orderManager/select_product.html");
- }
- if (in_array($user_role_id, array(6, 14))) {
- $menu_info["sub"][] = array("menu_name" => "补录订单", "menu_url" => $base_url . "/web/orderManager/resub_order.html");
- }
- if (in_array($user_role_id, array(6, 7, 10, 14))) {
- $menu_info["sub"][] = array("menu_name" => "订单列表", "menu_url" => $base_url . "/web/orderManager/order_list.html");
- }
- $menu_array[] = $menu_info;
- }
- if (in_array($user_role_id, array(6, 10))) {
- $menu_info["main"] = " 财务列表 ";
- $menu_info["sub"] = array();
- if (in_array($user_role_id, array(6, 10))) {
- $menu_info["sub"][] = array("menu_name" => "出团报账", "menu_url" => $base_url . "/web/financialStatement/group_statement.html");
- }
- $menu_array[] = $menu_info;
- }
- if (in_array($user_role_id, array(6, 7, 14))) {
- $menu_info["main"] = " 合作商管理 ";
- $menu_info["sub"] = array();
- if (in_array($user_role_id, array(6))) {
- $menu_info["sub"][] = array("menu_name" => "供应商管理", "menu_url" => $base_url . "/web/channelManager/supplier_list.htm");
- }
- if (in_array($user_role_id, array(6, 7, 14))) {
- $menu_info["sub"][] = array("menu_name" => "渠道商管理", "menu_url" => $base_url . "/web/channelManager/channel_list.html");
- }
- $menu_array[] = $menu_info;
- }
-
- //$default_url = $base_url . "/order_list.html";
- if (in_array($user_role_id, array(0, 1, 2))) {
- $default_url = $base_url1 . "/zzcs/finance/bus-cost-form";
- } else if (in_array($user_role_id, array(4, 5, 8, 9, 13, 15))) {
- $default_url = $base_url . "/order_list.html";
- } else if (in_array($user_role_id, array(3, 12))) {
- $default_url = $base_url . "/zz-jd/hotel_order_list.html";
- } else if (in_array($user_role_id, array(6, 7, 10, 14))) {
- $default_url = $base_url . "/web/orderManager/order_list.html";
- } else if (in_array($user_role_id, array(11))) {
- $default_url = $base_url1 . "/hotel/supplier-backend/index";
- } else {
- $default_url = $base_url . "/order_list.html";
- }
-
- $menu_info["main"] = " 系统设置 ";
- $menu_info["sub"] = array();
- if (in_array($user_role_id, array(0))) {
- $menu_info["sub"][] = array("menu_name" => "账号管理", "menu_url" => $base_url1 . "/zzcs/account/account-list");
- }
- $menu_info["sub"][] = array("menu_name" => "修改密码", "menu_url" => $base_url . "/changePassword.html");
- $menu_array[] = $menu_info;
-
- $json["menu"] = $menu_array;
- $json["default_url"] = $default_url;
- return json_encode($json);
- }
-
- public function actionMenu()
- {
- if(Yii::$app->user->isGuest){
- if(!User::cs1Login()){
- return $this->redirect('http://'. CS_DOMAIN);
- }
- }
- return $this->render('menu');
- }
- public function actionMenu2()
- {
- $this->layout = '@backend/views/layouts/menu2.php';
- return $this->render('menu');
- }
- }
|