You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

295 lines
16 KiB

  1. <?php
  2. namespace backend\controllers;
  3. use common\models\User;
  4. use Yii;
  5. use yii\web\Controller;
  6. use backend\modules\zzcs\models\BaseUser;
  7. class MenuController extends Controller
  8. {
  9. public $enableCsrfValidation = false;
  10. public $layout = '@backend/views/layouts/menu.php';
  11. /**
  12. * Function Description:获取菜单
  13. * Function Name: actionIndex
  14. *
  15. * @return string
  16. *
  17. * @author Redstop
  18. */
  19. public function actionIndex()
  20. {
  21. $base_url = "http://". CS_DOMAIN;
  22. $base_url1 = "http://". CS1_DOMAIN;
  23. $base_url2 = "http://fx.". DOMAIN;
  24. // $base_url = "http://sandbox.zhizhuchuxing.com";
  25. // $base_url1 = "http://sandbox1.zhizhuchuxing.com";
  26. $request = Yii::$app->request;
  27. $user_id = $request->post("user_id");//需要更新的bus_id
  28. $model_user = new BaseUser();
  29. $user_info = $model_user->getUserInfo($user_id);
  30. $user_role_id = $user_info[0]["USER_ROLE"];
  31. $main_corp_id = $user_info[0]["MAIN_CORP_ID"];
  32. if( $main_corp_id == 4 ) {
  33. $base_url2 = "http://qdhfx.". DOMAIN;
  34. }
  35. $json = array();
  36. $json["code"] = "0";
  37. $menu_array = array();
  38. $menu_info = array();
  39. if (in_array($user_role_id, array(0, 1, 2, 3, 8, 12, 13, 15, 16))) {
  40. $menu_info["main"] = " 基础信息配置管理 ";
  41. $menu_info["sub"] = array();
  42. if (in_array($user_role_id, array(0, 1, 2, 8, 13, 15,16))) {
  43. $menu_info["sub"][] = array("menu_name" => "站点/区域管理", "menu_url" => $base_url1 . "/zzcs/station/list");
  44. $menu_info["sub"][] = array("menu_name" => "站点/区域审核", "menu_url" => $base_url1 . "/zzcs/station/audit-list");
  45. }
  46. if (in_array($user_role_id, array(0, 3, 12, 13))) {
  47. $menu_info["sub"][] = array("menu_name" => "酒店基础信息管理", "menu_url" => $base_url . "/zz-jd/hotel_list.html");
  48. }
  49. if (in_array($user_role_id, array(0, 1, 3, 8, 13,16))) {
  50. $menu_info["sub"][] = array("menu_name" => "供应商管理", "menu_url" => $base_url . "/supplier_list.html");
  51. }
  52. if (in_array($user_role_id, array(0))) {
  53. $menu_info["sub"][] = array("menu_name" => "渠道商管理", "menu_url" => $base_url . "/channel_list.html");
  54. }
  55. $menu_array[] = $menu_info;
  56. }
  57. if (in_array($user_role_id, array(0, 1, 2, 3, 8, 9, 12, 13, 15,16))) {
  58. $menu_info["main"] = " 产品管理 ";
  59. $menu_info["sub"] = array();
  60. if (in_array($user_role_id, array(0, 1, 2, 8, 9, 13, 15,16))) {
  61. $menu_info["sub"][] = array("menu_name" => "巴士线路管理", "menu_url" => $base_url . "/web/lineManager/line_list.html");
  62. }
  63. if (in_array($user_role_id, array(0, 1, 2, 3, 8, 9, 12, 13, 15))) {
  64. $menu_info["sub"][] = array("menu_name" => "门票产品管理", "menu_url" => $base_url1 . "/zzcs/prod/prod-list");
  65. }
  66. if (in_array($user_role_id, array(0, 3, 12, 13))) {
  67. $menu_info["sub"][] = array("menu_name" => "酒店上下架管理", "menu_url" => $base_url . "/zz-jd/up_down_control.html");
  68. }
  69. $menu_array[] = $menu_info;
  70. }
  71. if (in_array($user_role_id, array(0, 1, 2, 3, 8, 12, 13, 15,16))) {
  72. $menu_info["main"] = " 库存管理 ";
  73. $menu_info["sub"] = array();
  74. if (in_array($user_role_id, array(0, 3, 12, 13))) {
  75. // $menu_info["sub"][] = array("menu_name" => "酒店房态管理", "menu_url" => $base_url . "/zz-jd/hotel_product_list.html");
  76. $menu_info["sub"][] = array("menu_name" => "酒店房态管理", "menu_url" => $base_url . "/zz-jd/hotel_product_list.html");
  77. }
  78. if (in_array($user_role_id, array(0, 1, 2, 8, 13, 15,16))) {
  79. $menu_info["sub"][] = array("menu_name" => "巴士车次管理", "menu_url" => $base_url . "/carList.html");
  80. }
  81. if (in_array($user_role_id, array(0, 1, 2, 3, 8, 12, 13, 15,16))) {
  82. $menu_info["sub"][] = array("menu_name" => "巴士成本管理", "menu_url" => $base_url1 . "/zzcs/line/cost-list");
  83. }
  84. $menu_array[] = $menu_info;
  85. }
  86. if (in_array($user_role_id, array(0, 1, 2, 3, 5, 8, 12, 13, 15,16))) {
  87. $menu_info["main"] = " 录单管理 ";
  88. $menu_info["sub"] = array();
  89. if (in_array($user_role_id, array(0, 1, 2, 5, 8, 12, 13, 15,16))) {
  90. $menu_info["sub"][] = array("menu_name" => "巴士订单录入", "menu_url" => $base_url . "/web/orderManager/select_product.html");
  91. }
  92. if (in_array($user_role_id, array(0, 1, 5, 12, 13))) {
  93. if( $main_corp_id == 0 ) {
  94. $menu_info["sub"][] = array("menu_name" => "门票订单录入", "menu_url" => $base_url . "/special_ticket.html");
  95. } else {
  96. $menu_info["sub"][] = array("menu_name" => "门票订单录入", "menu_url" => $base_url1 . "/zzcs/prod/fill-order");//test
  97. }
  98. }
  99. if (in_array($user_role_id, array(0, 3, 5, 12, 13))) {
  100. $menu_info["sub"][] = array("menu_name" => "酒店订单录入", "menu_url" => $base_url . "/zz-jd/choose_product.html");
  101. }
  102. if (in_array($user_role_id, array(0))) {
  103. $menu_info["sub"][] = array("menu_name" => "定制巴士订单录入", "menu_url" => $base_url1 . "/motorcade/zizai/create");
  104. }
  105. /*
  106. if (in_array($user_role_id, array(0))) {
  107. $menu_info["sub"][] = array("menu_name" => "组合线路订单补录", "menu_url" => $base_url . "/web/orderManager/resub_order.html");
  108. }
  109. */
  110. $menu_array[] = $menu_info;
  111. }
  112. if (in_array($user_role_id, array(0, 1, 2, 3, 4, 5, 8, 9, 11, 12, 13, 15,16))) {
  113. $menu_info["main"] = " 订单管理 ";
  114. $menu_info["sub"] = array();
  115. if (in_array($user_role_id, array(0, 1, 2, 3, 4, 5, 8, 9, 12, 13, 15,16))) {
  116. $menu_info["sub"][] = array("menu_name" => "巴士订单列表", "menu_url" => $base_url . "/order_list.html");
  117. }
  118. /*
  119. if (in_array($user_role_id, array(0))) {
  120. $menu_info["sub"][] = array("menu_name" => "组合线路订单列表", "menu_url" => $base_url . "/web/orderManager/order_list.html");
  121. }
  122. */
  123. if (in_array($user_role_id, array(0, 1, 3, 4, 5, 12, 13))) {
  124. $menu_info["sub"][] = array("menu_name" => "门票订单列表", "menu_url" => $base_url . "/des_order_list.html");
  125. }
  126. if (in_array($user_role_id, array(0, 3, 4, 5, 12, 13))) {
  127. $menu_info["sub"][] = array("menu_name" => "酒店订单列表", "menu_url" => $base_url . "/zz-jd/hotel_order_list.html");
  128. // $menu_info["sub"][] = array("menu_name" => "酒店历史订单列表", "menu_url" => $base_url . "/zz-jd/zwy_hotel_order_list.html");
  129. }
  130. if (in_array($user_role_id, array(11))) {
  131. $menu_info["sub"][] = array("menu_name" => "酒店订单列表", "menu_url" => $base_url . "/zz-jd/outside_hotel_order_list.html");
  132. }
  133. if (in_array($user_role_id, array(0))) {
  134. $menu_info["sub"][] = array("menu_name" => "定制巴士订单列表", "menu_url" => $base_url1 . "/motorcade/zizai");
  135. }
  136. $menu_array[] = $menu_info;
  137. }
  138. if (in_array($user_role_id, array(0, 1, 2, 8, 9, 13, 15,16))) {
  139. $menu_info["main"] = " 车队运营管理 ";
  140. $menu_info["sub"] = array();
  141. if (in_array($user_role_id, array(0, 1, 2, 8, 9, 13, 15,16))) {
  142. $menu_info["sub"][] = array("menu_name" => "车辆司机管理", "menu_url" => $base_url1 . "/zzcs/car/list");
  143. /*
  144. $menu_info["sub"][] = array("menu_name" => "车型基础信息配置", "menu_url" => $base_url1 . "/zzcs/base/brand-list");
  145. $menu_info["sub"][] = array("menu_name" => "车辆管理", "menu_url" => $base_url1 . "/zzcs/car/list");
  146. $menu_info["sub"][] = array("menu_name" => "司机管理", "menu_url" => $base_url1 . "/zzcs/driver/list");
  147. */
  148. $menu_info["sub"][] = array("menu_name" => "车辆调度", "menu_url" => $base_url . "/branchmoney.html");
  149. }
  150. /*
  151. if (in_array($user_role_id, array(0))) {
  152. $menu_info["sub"][] = array("menu_name" => "组合线路车辆调度", "menu_url" => $base_url . "/web/vehiclesDispatch/single_dispatch.html");
  153. }
  154. */
  155. $menu_array[] = $menu_info;
  156. }
  157. if (in_array($user_role_id, array( 0, 1, 4, 13 ))) {
  158. $menu_info["main"] = " 分销管理 ";
  159. $menu_info["sub"] = array();
  160. if (in_array($user_role_id, array(0, 1, 13))) {
  161. $menu_info["sub"][] = array("menu_name" => "产品管理", "menu_url" => $base_url2 . "/web/admin/product_list.html");
  162. $menu_info["sub"][] = array("menu_name" => "订单管理", "menu_url" => $base_url2 . "/web/admin/order_list.html");
  163. }
  164. if (in_array($user_role_id, array(0, 1, 4, 13))) {
  165. $menu_info["sub"][] = array("menu_name" => "分销商列表", "menu_url" => $base_url2 . "/web/admin/distributor_list.html");
  166. $menu_info["sub"][] = array("menu_name" => "提现申请列表", "menu_url" => $base_url2 . "/web/admin/withdrawal_list.html");
  167. }
  168. $menu_array[] = $menu_info;
  169. }
  170. if (in_array($user_role_id, array(0, 1, 2, 3, 4, 5, 8, 12, 13, 15,16))) {
  171. $menu_info["main"] = " 统计报表 ";
  172. $menu_info["sub"] = array();
  173. if (in_array($user_role_id, array(0, 1, 2, 4, 5, 8, 12, 13, 15))) {
  174. $menu_info["sub"][] = array("menu_name" => "巴士业绩统计(含成本)", "menu_url" => $base_url1 . "/zzcs/finance/bus-cost-form");
  175. }
  176. if (in_array($user_role_id, array(0, 1, 2, 4, 5, 8, 12, 13, 15,16))) {
  177. $menu_info["sub"][] = array("menu_name" => "巴士业绩统计", "menu_url" => $base_url1 . "/zzcs/order/order-statistical-form");
  178. }
  179. if (in_array($user_role_id, array(0, 3, 4, 12, 13, 15))) {
  180. $menu_info["sub"][] = array("menu_name" => "酒店销售统计", "menu_url" => $base_url1 . "/hotel/report/sales");
  181. $menu_info["sub"][] = array("menu_name" => "酒店渠道统计", "menu_url" => $base_url1 . "/hotel/report/sale-channel");
  182. $menu_info["sub"][] = array("menu_name" => "酒店客服业绩统计", "menu_url" => $base_url1 . "/hotel/report/customer");
  183. $menu_info["sub"][] = array("menu_name" => "酒店采购业绩统计", "menu_url" => $base_url1 . "/hotel/report/purchase");
  184. }
  185. $menu_array[] = $menu_info;
  186. }
  187. ///////////////////////////////////////////////////
  188. // 厦门 6,7,10,14 //
  189. ///////////////////////////////////////////////////
  190. if (in_array($user_role_id, array(6, 14))) {
  191. $menu_info["main"] = " 产品管理 ";
  192. $menu_info["sub"] = array();
  193. if (in_array($user_role_id, array(6))) {
  194. $menu_info["sub"][] = array("menu_name" => "车辆管理", "menu_url" => $base_url . "/web/busManager/carList.html");
  195. }
  196. if (in_array($user_role_id, array(6))) {
  197. $menu_info["sub"][] = array("menu_name" => "线路管理", "menu_url" => $base_url . "/web/lineManager/line_list.html");
  198. }
  199. if (in_array($user_role_id, array(6, 14))) {
  200. $menu_info["sub"][] = array("menu_name" => "车辆调度", "menu_url" => $base_url . "/web/vehiclesDispatch/single_dispatch.html");
  201. }
  202. $menu_array[] = $menu_info;
  203. }
  204. if (in_array($user_role_id, array(6, 7, 10, 14))) {
  205. $menu_info["main"] = " 订单管理 ";
  206. $menu_info["sub"] = array();
  207. if (in_array($user_role_id, array(6, 7, 14))) {
  208. $menu_info["sub"][] = array("menu_name" => "录入订单", "menu_url" => $base_url . "/web/orderManager/select_product.html");
  209. }
  210. if (in_array($user_role_id, array(6, 14))) {
  211. $menu_info["sub"][] = array("menu_name" => "补录订单", "menu_url" => $base_url . "/web/orderManager/resub_order.html");
  212. }
  213. if (in_array($user_role_id, array(6, 7, 10, 14))) {
  214. $menu_info["sub"][] = array("menu_name" => "订单列表", "menu_url" => $base_url . "/web/orderManager/order_list.html");
  215. }
  216. $menu_array[] = $menu_info;
  217. }
  218. if (in_array($user_role_id, array(6, 10))) {
  219. $menu_info["main"] = " 财务列表 ";
  220. $menu_info["sub"] = array();
  221. if (in_array($user_role_id, array(6, 10))) {
  222. $menu_info["sub"][] = array("menu_name" => "出团报账", "menu_url" => $base_url . "/web/financialStatement/group_statement.html");
  223. }
  224. $menu_array[] = $menu_info;
  225. }
  226. if (in_array($user_role_id, array(6, 7, 14))) {
  227. $menu_info["main"] = " 合作商管理 ";
  228. $menu_info["sub"] = array();
  229. if (in_array($user_role_id, array(6))) {
  230. $menu_info["sub"][] = array("menu_name" => "供应商管理", "menu_url" => $base_url . "/web/channelManager/supplier_list.htm");
  231. }
  232. if (in_array($user_role_id, array(6, 7, 14))) {
  233. $menu_info["sub"][] = array("menu_name" => "渠道商管理", "menu_url" => $base_url . "/web/channelManager/channel_list.html");
  234. }
  235. $menu_array[] = $menu_info;
  236. }
  237. //$default_url = $base_url . "/order_list.html";
  238. if (in_array($user_role_id, array(0, 1, 2))) {
  239. $default_url = $base_url1 . "/zzcs/finance/bus-cost-form";
  240. } else if (in_array($user_role_id, array(4, 5, 8, 9, 13, 15))) {
  241. $default_url = $base_url . "/order_list.html";
  242. } else if (in_array($user_role_id, array(3, 12))) {
  243. $default_url = $base_url . "/zz-jd/hotel_order_list.html";
  244. } else if (in_array($user_role_id, array(6, 7, 10, 14))) {
  245. $default_url = $base_url . "/web/orderManager/order_list.html";
  246. } else if (in_array($user_role_id, array(11))) {
  247. $default_url = $base_url1 . "/hotel/supplier-backend/index";
  248. } else {
  249. $default_url = $base_url . "/order_list.html";
  250. }
  251. $menu_info["main"] = " 系统设置 ";
  252. $menu_info["sub"] = array();
  253. if (in_array($user_role_id, array(0))) {
  254. $menu_info["sub"][] = array("menu_name" => "账号管理", "menu_url" => $base_url1 . "/zzcs/account/account-list");
  255. }
  256. $menu_info["sub"][] = array("menu_name" => "修改密码", "menu_url" => $base_url . "/changePassword.html");
  257. $menu_array[] = $menu_info;
  258. $json["menu"] = $menu_array;
  259. $json["default_url"] = $default_url;
  260. return json_encode($json);
  261. }
  262. public function actionMenu()
  263. {
  264. if(Yii::$app->user->isGuest){
  265. if(!User::cs1Login()){
  266. return $this->redirect('http://'. CS_DOMAIN);
  267. }
  268. }
  269. return $this->render('menu');
  270. }
  271. public function actionMenu2()
  272. {
  273. $this->layout = '@backend/views/layouts/menu2.php';
  274. return $this->render('menu');
  275. }
  276. }