您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

554 行
24 KiB

  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: 张帅
  5. * Date: 2016/10/12
  6. * Time: 14:30
  7. */
  8. class singleLine extends base
  9. {
  10. /**
  11. * @param line_id 线路id
  12. * @param line_name 线路名称
  13. * @param line_code 线路代码
  14. * @param line_type 线路类型1
  15. * @param line_sub_type 线路类型2
  16. * @param time_type 时间类型
  17. * @param time_info 时间
  18. * @param supply_id 供应商id
  19. * @param station_list 线路id 格式{上下车类型,站点顺序,到达用时,检票口,站点RES_ID,站点AREA_ID} 上下车类型: 108:上车 109:同时上下车 110:下客 114:不停靠;检票口目前默认都为0,如果有检票口需要在base_resource中配置
  20. * @return array|null
  21. * User: Steven
  22. */
  23. function addLine($param)
  24. {
  25. $valid = zzcsUtils::validateParams(array('line_name,line_code,line_type,line_sub_type,time_type,time_info,supply_id,station_list,allow_selected_seat' => 'empty'), $param);
  26. if (!$valid['status']) {
  27. $result['code'] = (string)$valid['status'];
  28. $result['info'] = $valid['info'];
  29. return $result;
  30. }
  31. $line_name = isset($param['line_name']) ? trim($param['line_name']) : false;//线路名称
  32. $line_code = isset($param['line_code']) ? trim($param['line_code']) : false;//线路代码
  33. $line_type = isset($param['line_type']) ? trim($param['line_type']) : false;//线路类型1
  34. $line_sub_type = isset($param['line_sub_type']) ? trim($param['line_sub_type']) : false;//线路类型2
  35. $time_type = isset($param['time_type']) ? trim($param['time_type']) : false;//时间类型
  36. $time_info = isset($param['time_info']) ? trim($param['time_info']) : false;//时间
  37. $supply_id = isset($param['supply_id']) ? trim($param['supply_id']) : false;//供应商id
  38. //格式{上下车类型,站点顺序,到达用时,检票口,站点RES_ID,站点AREA_ID} 上下车类型: 108:上车 109:同时上下车 110:下客 114:不停靠;检票口目前默认都为0,如果有检票口需要在base_resource中配置
  39. $station_list = isset($param['station_list']) ? trim($param['station_list']) : false;//站点列表
  40. $allow_selected_seat = isset($param['allow_selected_seat']) ? trim($param['allow_selected_seat']) : false;//是否支持换座
  41. $user_id = $this->user_id;
  42. $data = [
  43. 'user_id'=>$user_id,
  44. 'line_name'=>$line_name,
  45. 'line_code'=>$line_code,
  46. 'line_type'=>$line_type,
  47. 'line_sub_type'=>$line_sub_type,
  48. 'time_type'=>$time_type,
  49. 'time_info'=>$time_info,
  50. 'supply_id'=>$supply_id,
  51. 'station_list'=>$station_list,
  52. 'allow_selected_seat'=>$allow_selected_seat,
  53. ];
  54. $result=$this->httpRequest('http://'.CS1_DOMAIN.'/api/run-edit/add-line',$data);
  55. // $sql_check = 'SELECT line_id count from opera_line WHERE line_code = \'' . $line_code . '\' AND cancel_flag = 0';
  56. // $res_check = $this->query($sql_check);
  57. // if (count($res_check) > 0) {
  58. // $result['code'] = '3';
  59. // $result['info'] = "线路编号已存在";
  60. // return $result;
  61. // }
  62. // $sql = "CALL sp_add_line_station_xm(" . $user_id . ",'" . $line_name . "','" . $line_code . "'," . $line_type . "," . $line_sub_type . "," . $time_type . ",'" . $time_info . "'," . $supply_id . ",'" . $station_list . "')";
  63. // zzcsUtils::writeLog($sql);
  64. // $result = $this->procQuery($sql);
  65. // if ($result['code'] == 0) {
  66. // $json['code'] = '0';
  67. // $json['info'] = '添加线路成功';
  68. // $json['line_id'] = $result['data'][0][0]['line_id'];
  69. // $json['line_type'] = $line_type;
  70. // } else {
  71. // $json['code'] = $result['code'];
  72. // $json['info'] = $result['info'];
  73. // }
  74. // echo json_encode($json);
  75. return json_decode($result);
  76. }
  77. function httpRequest($url, $data = null)
  78. {
  79. $ch = curl_init();
  80. curl_setopt($ch, CURLOPT_URL, $url);
  81. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  82. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  83. if (!empty($data)) {
  84. curl_setopt($ch, CURLOPT_POST, 1);
  85. curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  86. }
  87. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  88. $output = curl_exec($ch);
  89. curl_close($ch);
  90. return $output;
  91. }
  92. /**
  93. * 单一线路详情
  94. * @param $param
  95. */
  96. function getLineDetail($param)
  97. {
  98. $line_id = isset($param['line_id']) ? trim($param['line_id']) : false;//线路id
  99. if (!$line_id) {
  100. $json['code'] = '2';
  101. $json['info'] = '缺少必要参数';
  102. return $json;
  103. }
  104. $data = array(
  105. 'line_id' => $line_id
  106. );
  107. $json = $this->httpRequest('http://' . CS1_DOMAIN . '/api/run-edit/get-line-detail', $data);
  108. // $sql = "SELECT
  109. // l.tailor_flag,l.line_id,l.line_name,l.line_code,l.line_type,l.org_id,l.sale_expired_type,l.sale_expired_time,s.order_id,s.res_id,s.start_minutes,s.inout_type,s.checkport_res_id,s.area_id,s.distance,l.allow_select_seat
  110. // FROM
  111. // opera_line AS l,
  112. // opera_station AS s
  113. // WHERE
  114. // l.line_id = s.line_id
  115. // AND l.cancel_flag = 0
  116. // AND s.cancel_flag = 0
  117. // AND l.line_id = " . $line_id;
  118. // $line_info = $this->query($sql);
  119. // if (count($line_info) == 0) {
  120. // $json['code'] = '1';
  121. // $json['info'] = '该线路配置不全';
  122. // return $json;
  123. // }
  124. // foreach ($line_info as $k => $v) {
  125. // if (!isset($line_base_info)) {
  126. // $line_base_info['tailor_flag'] = $v['tailor_flag'];
  127. // $line_base_info['line_id'] = $v['line_id'];
  128. // $line_base_info['line_name'] = $v['line_name'];
  129. // $line_base_info['line_code'] = $v['line_code'];
  130. // $line_base_info['line_type'] = $v['line_type'];
  131. // $line_base_info['org_id'] = $v['org_id'];
  132. // $line_base_info['sale_expired_type'] = $v['sale_expired_type'];
  133. // $line_base_info['sale_expired_time'] = $v['sale_expired_time'];
  134. // }
  135. // $res_base_info[$v['order_id']]['res_id'] = $v['res_id'];
  136. // $res_base_info[$v['order_id']]['inout_type'] = $v['inout_type'];
  137. // $res_base_info[$v['order_id']]['checkport_res_id'] = $v['checkport_res_id'];
  138. // $res_base_info[$v['order_id']]['area_id'] = $v['area_id'];
  139. // $res_base_info[$v['order_id']]['start_minutes'] = $v['start_minutes'];
  140. // $res_base_info[$v['order_id']]['distance'] = $v['distance'];
  141. // }
  142. // ksort($res_base_info);
  143. // foreach ($res_base_info as $order_id => $res_v) {
  144. // $res_detail_info = $this->getStationInfo(array('res_id' => $res_v['res_id']));
  145. // if ($res_detail_info['code'] != '0') {
  146. // $json['code'] = '1';
  147. // $json['info'] = '站点信息有误';
  148. // return $json;
  149. // }
  150. // $res_detail_info = $res_detail_info['res_info'];
  151. // foreach ($res_detail_info['parent_area'] as $k => $v) {
  152. // if ($v['id'] == $res_v['area_id']) {
  153. // $res_detail_info['parent_area'][$k]['checked'] = '1';
  154. // } else {
  155. // $res_detail_info['parent_area'][$k]['checked'] = '0';
  156. // }
  157. // }
  158. // foreach ($res_detail_info['inout_type'] as $k => $v) {
  159. // if ($v['id'] == $res_v['inout_type']) {
  160. // $res_detail_info['inout_type'][$k]['checked'] = '1';
  161. // } else {
  162. // $res_detail_info['inout_type'][$k]['checked'] = '0';
  163. // }
  164. // }
  165. // foreach ($res_detail_info['check_port'] as $k => $v) {
  166. // if ($v['id'] == $res_v['checkport_res_id']) {
  167. // $res_detail_info['check_port'][$k]['checked'] = '1';
  168. // } else {
  169. // $res_detail_info['check_port'][$k]['checked'] = '0';
  170. // }
  171. // }
  172. // $res_detail_info['start_minutes'] = $res_v['start_minutes'];
  173. // $res_detail_info['distance'] = $res_v['distance'];
  174. // $res_array[$order_id] = $res_detail_info;
  175. // }
  176. // $json['code'] = '0';
  177. // $json['info'] = '返回数据成功';
  178. // $json['line_info'] = $line_base_info;
  179. // $json['station_info'] = array_merge($res_array);
  180. return json_decode($json);
  181. }
  182. /**
  183. * 获取线路列表配置信息
  184. * @return mixed
  185. */
  186. function getLineListBase()
  187. {
  188. $res = $this->productLine(); //获取产品线
  189. $supply = $this->getSupply();
  190. $json['code'] = '0';
  191. $json['info'] = '获取供应商列表成功';
  192. $json['product_list'] = $res;
  193. $json['supply_list'] = $supply;
  194. return $json;
  195. }
  196. /**
  197. * 单一线路列表
  198. * @param $param
  199. */
  200. function getLineList($post)
  201. {
  202. $page_size = isset($post['page_size']) ? trim($post['page_size']) : false;
  203. $current_page = isset($post['current_page']) ? trim($post['current_page']) : false;
  204. $line_code = isset($post['line_code']) ? (empty($post['line_code']) ? "''" : "'" . trim($post['line_code']) . "'") : false;
  205. $supply_id = isset($post['supply_id']) ? trim($post['supply_id']) : false;
  206. $line_status = isset($post['line_status']) ? trim($post['line_status']) : false;
  207. $line_type = isset($post['line_type']) ? trim($post['line_type']) : false;
  208. $tailor_type = isset($post['tailor_type']) ? $post['tailor_type'] : 0;
  209. if (!$page_size || !$current_page || !$line_code || !$supply_id || !$line_type) {
  210. $json['code'] = '2';
  211. $json['info'] = '缺少必要参数';
  212. return $json;
  213. }
  214. $where['line_type'] = $line_type;
  215. $where['line_code'] = $line_code;
  216. $where['supply_id'] = $supply_id;
  217. $where['line_status'] = $line_status;
  218. $where['tailor_type'] = $tailor_type;
  219. $start_row = ($current_page - 1) * $page_size;
  220. $extra_sql = "";
  221. if (isset($_COOKIE["opera_org_id"]) && mb_strlen($_COOKIE["opera_org_id"]) > 0) {
  222. $extra_sql .= ' AND ORG_ID IN( ' . $_COOKIE["opera_org_id"] . ' ) ';
  223. }
  224. if (isset($_COOKIE["user_main_corp"]) && mb_strlen($_COOKIE["user_main_corp"]) > 0 && $_COOKIE["user_main_corp"] > 0) {
  225. $extra_sql .= ' AND MAIN_CORP_ID IN( ' . $_COOKIE["user_main_corp"] . ' ) ';
  226. }
  227. $search_line_type = "l.line_type = " . $where['line_type'] . ' AND l.tailor_type = ' . $where['tailor_type'];
  228. if ($where['line_type'] == 255) {
  229. $search_line_type = "l.line_type IN (255,368) ";//一日游线路
  230. }
  231. $sql = "SELECT
  232. l.line_id,l.line_code,l.line_name,
  233. IFNULL((SELECT type_name FROM dict_type WHERE id = l.line_sub_type),'') AS line_sub_type,
  234. IFNULL((SELECT supplier_name FROM base_supplier WHERE id = l.org_id ), '' ) AS org_name,
  235. CASE l.if_disabled WHEN 0 THEN '启用' ELSE '停用' END AS disabled_status,
  236. count(t.id) AS cnt
  237. FROM
  238. opera_line AS l LEFT JOIN
  239. (SELECT id,line_id FROM opera_tickets_group WHERE cancel_flag = 0) AS t
  240. ON l.line_id = t.line_id
  241. WHERE
  242. l.cancel_flag = 0
  243. AND {$search_line_type}
  244. AND IF(TRIM(" . $where['line_code'] . ")='',0=0,(l.line_code LIKE CONCAT('%'," . $where['line_code'] . ",'%') OR l.line_name LIKE CONCAT('%'," . $where['line_code'] . ",'%')))
  245. AND IF(TRIM(" . $where['supply_id'] . ")=-1,0=0,l.org_id = " . $where['supply_id'] . ")
  246. AND IF(TRIM(" . $where['line_status'] . ")=-1,0=0,l.if_disabled = " . $where['line_status'] . ")" . $extra_sql . "
  247. GROUP BY
  248. l.line_id,l.line_code,l.line_name,l.line_sub_type,l.org_id,l.if_disabled
  249. ORDER BY
  250. l.line_id DESC
  251. LIMIT " . $start_row . "," . $page_size;
  252. $line_list = $this->query($sql);
  253. if (count($line_list) == 0) {
  254. $json['code'] = '0';
  255. $json['info'] = '没有符合的线路';
  256. $json['line_list'] = array();
  257. $json['page']['page_size'] = $page_size;
  258. $json['page']['current_page'] = $current_page;
  259. $json['page']['total_count'] = '0';
  260. $json['page']['total_page'] = '0';
  261. return $json;
  262. }
  263. $count_sql = "SELECT
  264. count(line_id) as total_count
  265. FROM
  266. opera_line as l
  267. WHERE
  268. cancel_flag = 0
  269. AND {$search_line_type}
  270. AND IF(TRIM(" . $where['line_code'] . ")='',0=0,(line_code LIKE CONCAT('%'," . $where['line_code'] . ",'%') OR line_name LIKE CONCAT('%'," . $where['line_code'] . ",'%')))
  271. AND IF(TRIM(" . $where['supply_id'] . ")=-1,0=0,org_id = " . $where['supply_id'] . ")
  272. AND IF(TRIM(" . $where['line_status'] . ")=-1,0=0,if_disabled = " . $where['line_status'] . ") " . $extra_sql;
  273. $total_count = $this->query($count_sql);
  274. $total_count = $total_count[0]['total_count'];
  275. $total_page = ceil($total_count / $page_size);
  276. $json['code'] = '0';
  277. $json['info'] = '返回线路列表成功符合的线路';
  278. $json['line_list'] = $line_list;
  279. $json['page']['page_size'] = $page_size;
  280. $json['page']['current_page'] = $current_page;
  281. $json['page']['total_count'] = $total_count;
  282. $json['page']['total_page'] = $total_page;
  283. return $json;
  284. }
  285. /**
  286. * @param tailor_flag 接驳flag
  287. * @param line_id 线路id
  288. * @param line_name 线路名称
  289. * @param line_code 线路代码
  290. * @param line_type 线路类型1
  291. * @param line_sub_type 线路类型2
  292. * @param time_type 时间类型
  293. * @param time_info 时间
  294. * @param supply_id 供应商id
  295. * @param station_list 线路id 格式{上下车类型,站点顺序,到达用时,检票口,站点RES_ID,站点AREA_ID} 上下车类型: 108:上车 109:同时上下车 110:下客 114:不停靠;检票口目前默认都为0,如果有检票口需要在base_resource中配置
  296. * @return array|null
  297. * User: Steven
  298. */
  299. function lineUpdate($param)
  300. {
  301. $valid = zzcsUtils::validateParams(array('line_id,line_name,line_code,line_type,line_sub_type,time_type,time_info,supply_id,station_list,allow_selected_seat' => 'empty'), $param);
  302. if (!$valid['status']) {
  303. $result['code'] = (string)$valid['status'];
  304. $result['info'] = $valid['info'];
  305. return $result;
  306. }
  307. $user_id = $this->user_id;
  308. $data = [
  309. 'user_id'=>$this->user_id,
  310. 'line_code'=>$param['line_code'],
  311. 'line_id'=>$param['line_id'],
  312. 'line_name'=>$param['line_name'],
  313. 'line_type'=>$param['line_type'],
  314. 'line_sub_type'=>$param['line_sub_type'],
  315. 'time_type'=>$param['time_type'],
  316. 'time_info'=>$param['time_info'],
  317. 'supply_id'=>$param['supply_id'],
  318. 'station_list'=>$param['station_list'],
  319. 'tailor_flag'=>$param['tailor_flag'],
  320. 'allow_selected_seat'=>$param['allow_selected_seat']
  321. ];
  322. $result=$this->httpRequest('http://'.CS1_DOMAIN.'/api/run-edit/upt-line',$data);
  323. // $sql_check = 'SELECT line_id count FROM opera_line WHERE cancel_flag = 0 AND line_code = \'' . $param['line_code'] . '\' AND line_id != ' . $param['line_id'];
  324. // $res_check = $this->query($sql_check);
  325. // if (count($res_check) > 0) {
  326. // $result['code'] = '3';
  327. // $result['info'] = "线路编号已存在";
  328. // return $result;
  329. // }
  330. // $sql = "CALL sp_update_line_station_xm(" . $user_id . "," . $param['line_id'] . ",'" . $param['line_name'] . "','" . $param['line_code'] . "'," . $param['line_type'] . "," . $param['line_sub_type'] . "," . $param['time_type'] . ",'" . $param['time_info'] . "'," . $param['supply_id'] . ",'" . $param['station_list'] . "'," . $param['tailor_flag'] . "," . $param['allow_selected_seat'] . ")";
  331. // zzcsUtils::writeLog($sql);
  332. // $result = $this->procQuery($sql);
  333. // if ($result['code'] == 0) {
  334. // $json['code'] = '0';
  335. // $json['info'] = '修改线路成功';
  336. // $json['line_id'] = $param['line_id'];
  337. // $json['line_type'] = $param['line_type'];
  338. // } else {
  339. // $json['code'] = $result['code'];
  340. // $json['info'] = $result['info'];
  341. // }
  342. return json_decode($result);
  343. }
  344. /**
  345. * 单一线路启用
  346. * @param $param
  347. */
  348. function lineStart($param)
  349. {
  350. //hyk
  351. $line_id = isset($param['line_id']) ? trim($param['line_id']) : false;
  352. if (!$line_id) {
  353. $json['code'] = '2';
  354. $json['info'] = '缺少必要参数';
  355. return $json;
  356. }
  357. $update_time = date('Y-m-d h:i:s');//更新时间
  358. $sql = "UPDATE opera_line SET if_disabled= 0 ,update_user_id=" . $this->user_id . " , update_time= '" . $update_time . "' WHERE line_id IN(" . $line_id . ") AND cancel_flag =0";
  359. $result = $this->exec($sql);
  360. if ($result === false) {
  361. $json['code'] = '1';
  362. $json['info'] = '数据库异常';
  363. return $json;
  364. } else {
  365. $json['code'] = '0';
  366. $json['info'] = '更新成功';
  367. return $json;
  368. }
  369. }
  370. /**
  371. * 单一线路停用
  372. * @param $param
  373. */
  374. function lineStop($param)
  375. {
  376. //hyk
  377. $line_id = isset($param['line_id']) ? trim($param['line_id']) : false;
  378. if (!$line_id) {
  379. $json['code'] = '2';
  380. $json['info'] = '缺少必要参数';
  381. return $json;
  382. }
  383. $update_time = date('Y-m-d h:i:s');//更新时间
  384. $sql = "UPDATE opera_line SET if_disabled= 1,update_user_id=" . $this->user_id . " , update_time= '" . $update_time . "' WHERE line_id IN(" . $line_id . ") AND cancel_flag =0";
  385. $result = $this->exec($sql);
  386. if ($result === false) {
  387. $json['code'] = '1';
  388. $json['info'] = '数据库异常';
  389. return $json;
  390. } else {
  391. $json['code'] = '0';
  392. $json['info'] = '更新成功';
  393. return $json;
  394. }
  395. }
  396. /**
  397. * 获取添加线路的基础信息
  398. * @param $param OK
  399. */
  400. function getBaseManager()
  401. {
  402. //1.售卖情况时间列表
  403. $time_type = $this->getTimeType();
  404. //2.巴士类型表
  405. $bus_type = $this->getBusType();
  406. //3.供应商列表
  407. $supply_list = $this->getSupply();
  408. $json['code'] = '0';
  409. $json['info'] = '返回数据成功';
  410. $json['bus_type'] = $bus_type;
  411. $json['supply_list'] = $supply_list;
  412. $json['time_type'] = $time_type;
  413. return $json;
  414. }
  415. /**
  416. * 获取全部站点
  417. * @param $param
  418. */
  419. function getLineStation($post)
  420. {
  421. $res_name = trim($post['res_name']);//输入框输入的站点信息
  422. $sql = "SELECT
  423. res_id,
  424. res_name
  425. FROM
  426. base_resource
  427. WHERE
  428. res_type_id = 24
  429. AND cancel_flag = 0
  430. AND res_name LIKE '%" . $res_name . "%'";
  431. $res_list = $this->query($sql);//场站列表
  432. $json['code'] = '0';
  433. $json['info'] = '返回数据成功';
  434. $json['res_list'] = $res_list;
  435. return $json;
  436. }
  437. /**
  438. * 获取站点详情
  439. * @param $param
  440. */
  441. function getStationInfo($post)
  442. {
  443. $res_id = trim($post['res_id']);//站点id
  444. $check_area = "SELECT
  445. ifnull(area_id, 0) AS area_id
  446. FROM
  447. base_resource
  448. WHERE
  449. res_id = " . $res_id;
  450. $area = $this->query($check_area);//场站列表
  451. if ($area[0]['area_id'] == 0) {
  452. $json['code'] = '1';
  453. $json['info'] = '该站点无应用POI,请先配置应用POI!';
  454. return $json;
  455. }
  456. //获取站点信息详情
  457. $station_info = "SELECT
  458. a.res_id,
  459. a.res_name,
  460. IFNULL(concat(b.parent_area_id_list,'{',b.area_id,'}'),'') AS parent_area_id_list,
  461. IFNULL(concat(b.parent_area_name_list,'{',b.area_name,'}'),'') AS parent_area_name_list,
  462. IFNULL(
  463. (
  464. SELECT
  465. group_concat(res_id)
  466. FROM
  467. base_resource
  468. WHERE
  469. res_type_id = 79
  470. AND cancel_flag = 0
  471. AND parent_id = a.res_id
  472. ),
  473. 0
  474. ) AS checkport_res_id,
  475. IFNULL(
  476. (
  477. SELECT
  478. group_concat(res_name)
  479. FROM
  480. base_resource
  481. WHERE
  482. res_type_id = 79
  483. AND cancel_flag = 0
  484. AND parent_id = a.res_id
  485. ),
  486. ''
  487. ) AS checkport_res_name
  488. FROM
  489. base_resource a
  490. LEFT JOIN base_area_view b ON a.area_id = b.area_id
  491. WHERE
  492. a.cancel_flag = 0
  493. AND a.res_id = " . $res_id;
  494. $res_info = $this->query($station_info);//场站详情
  495. $res_info = $res_info[0];
  496. $res_info['parent_area_id_list'] = substr($res_info['parent_area_id_list'], 1, -1);
  497. $res_info['parent_area_name_list'] = substr($res_info['parent_area_name_list'], 1, -1);
  498. $res_info['parent_area_id_list'] = explode("}{", $res_info['parent_area_id_list']);//应用POI站点id数组
  499. $res_info['parent_area_name_list'] = explode("}{", $res_info['parent_area_name_list']);//应用POI站点name数组
  500. $res_info['checkport_res_id'] = explode(",", $res_info['checkport_res_id']);//检票口id数组
  501. $res_info['checkport_res_name'] = explode(",", $res_info['checkport_res_name']);//检票口name数组
  502. //规整返回前端的站点数据
  503. $res = array();
  504. $res['res_id'] = $res_info['res_id'];
  505. $res['res_name'] = $res_info['res_name'];
  506. foreach ($res_info['parent_area_id_list'] as $k => $v) {
  507. $res['parent_area'][$k]['id'] = $v;
  508. $res['parent_area'][$k]['name'] = $res_info['parent_area_name_list'][$k];
  509. }
  510. foreach ($res_info['checkport_res_id'] as $k => $v) {
  511. $res['check_port'][$k]['id'] = $v;
  512. $res['check_port'][$k]['name'] = $res_info['checkport_res_name'][$k];
  513. }
  514. $res['inout_type'] = array(
  515. 0 => array(
  516. 'id' => '108',
  517. 'name' => '上'
  518. ),
  519. 1 => array(
  520. 'id' => '109',
  521. 'name' => '上下'
  522. ),
  523. 2 => array(
  524. 'id' => '110',
  525. 'name' => '下'
  526. )
  527. );
  528. $json['code'] = '0';
  529. $json['info'] = '返回数据成功';
  530. $json['res_info'] = $res;
  531. return $json;
  532. }
  533. }