Station_oracle.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  1. <?php
  2. namespace catchAdmin\device\controller;
  3. use catcher\base\CatchRequest as Request;
  4. use catcher\CatchResponse;
  5. use catcher\base\CatchController;
  6. // use catchAdmin\device\model\RfRecord as rfRecordModel;
  7. // use catchAdmin\device\model\Station as stationModel;
  8. // use catchAdmin\device\model\StationPhoto;
  9. use catcher\Utils;
  10. use catcher\library\excel\Excel;
  11. use PhpOffice\PhpSpreadsheet\IOFactory;
  12. use think\facade\Env;
  13. use think\facade\Db;
  14. use PDO;
  15. use think\facade\Cache;
  16. class Station extends CatchController
  17. {
  18. // protected $stationModel;
  19. // protected $rfRecordModel;
  20. // public function __construct(rfRecordModel $rfRecordModel,stationModel $stationModel)
  21. // {
  22. // $this->rfRecordModel = $rfRecordModel;
  23. // $this->stationModel = $stationModel;
  24. // }
  25. /**
  26. * 列表
  27. * @time 2022年01月20日 10:09
  28. * @param Request $request
  29. */
  30. public function index(Request $request)
  31. {
  32. $param=$request->param();
  33. $cond=[];
  34. if($param['shortcode']){
  35. $cond['a.DEVICE_CODE']=['like',$param['shortcode']];
  36. }
  37. if($param['name']){
  38. // $param['name'] = mb_convert_encoding($param['name'], 'GBK','UTF-8');
  39. $cond['a.DEVICE_NAME']=['like',$param['name']];
  40. }
  41. $count=queryOracleCount('DSSC2.ADM_DEV',$cond);
  42. $cond['page']=isset($param['page'])?$param['page']:1;
  43. $cond['limit']=isset($param['limit'])?$param['limit']:10;
  44. $rows=queryOracleSelect('(SELECT * FROM DSSC2.ADM_DEV ORDER BY ID DESC) a',$cond,'a.ID,a.IS_ONLINE,a.LOGIN_NAME,a.DEVICE_CODE,a.DEVICE_NAME,a.OWNER_CODE,a.DEVICE_IP,a.DEVICE_PORT,to_char(a.CREATE_DATE,\'yyyy-mm-dd hh24:mi:ss\') CREATE_DATE');
  45. foreach($rows as &$val){
  46. $val['IS_ONLINE_TEXT']=$val['IS_ONLINE']?'在线':'离线';
  47. $findCond=[
  48. 'DEVICE_CODE'=>['=',$val['DEVICE_CODE']]
  49. ];
  50. $info=queryOracleFind('DSSC2.ADM_DEV_RFID_CHN',$findCond);
  51. $val['longitude']=$info['GPS_X'];
  52. $val['latitude']=$info['GPS_Y'];
  53. }
  54. $response=[
  55. 'code'=>10000,
  56. 'message'=>'查询成功',
  57. 'count'=>$count,
  58. 'data'=>$rows,
  59. 'current'=>isset($param['page'])?(int)$param['page']:1,
  60. 'limit'=>isset($param['limit'])?(int)$param['limit']:10,
  61. ];
  62. return $response;
  63. }
  64. /**
  65. * 所有列表
  66. * @time 2022年01月20日 10:09
  67. * @param Request $request
  68. */
  69. public function getAllList(Request $request)
  70. {
  71. $list=Cache::get('stationList');
  72. if($list){
  73. return [
  74. 'code'=>10000,
  75. 'message'=>'查询成功',
  76. 'data'=>$list,
  77. ];
  78. }
  79. $cond=[
  80. '_string'=>'a.DEVICE_CODE = r.DEVICE_CODE',
  81. ];
  82. $cond['page']=1;
  83. $cond['limit']=30000;
  84. $conn = null;
  85. $tableName='(SELECT * FROM DSSC2.ADM_DEV ORDER BY ID DESC) a,DSSC2.ADM_DEV_RFID_CHN r';
  86. $field='a.ID,a.IS_ONLINE,a.LOGIN_NAME,a.DEVICE_CODE,a.DEVICE_NAME,a.OWNER_CODE,to_char(a.UPDATE_DATE,\'yyyy-mm-dd hh24:mi:ss\') UPDATE_DATE,r.GPS_X,r.GPS_Y';
  87. $host= Env::get('oracle.hostname', '127.0.0.1');
  88. $port= Env::get('oracle.hostport', '1521');
  89. $instance_name= Env::get('oracle.instance', 'ORCL');
  90. $username= Env::get('oracle.username', 'root');
  91. $password= Env::get('oracle.password', 'root');
  92. // $conn = oci_connect('用户名', '密码', '远程数据库名(eg.//192.168.1.133/orcl)');
  93. $conn = oci_connect($username, $password, $host.':'.$port.'/'. $instance_name,'AL32UTF8');
  94. if (!$conn) {
  95. $e = oci_error();
  96. trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
  97. }
  98. $start=($cond['page']-1)*$cond['limit'];
  99. $end=$cond['page']*$cond['limit'];
  100. $whereStr=buildQueryCond2($cond);
  101. $sql='SELECT * FROM ( SELECT '.$field.',ROWNUM RN FROM '.$tableName.' WHERE ROWNUM <='.$end.' '.$whereStr.' ) WHERE RN >'. $start;
  102. // $sql='SELECT '.$field.' FROM '.$tableName.' WHERE '.$whereStr;
  103. // var_dump($sql);
  104. // 查询并渲染
  105. $stid = oci_parse($conn, $sql);
  106. $r = oci_execute($stid);
  107. $rows=[];
  108. $save_data=[];
  109. while($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
  110. if($row['GPS_Y'] && $row['GPS_X']){
  111. // $wgsLoc = \algorithm\Geometry::wgsTOgcj((float)$row['GPS_Y'],(float)$row['GPS_X']);
  112. // $lngLat = \algorithm\Geometry::convertGcj02ToBd09($wgsLoc['lat'],$wgsLoc['lng']);
  113. // $row['GPS_X']=$lngLat['lng'];
  114. // $row['GPS_Y']=$lngLat['lat'];
  115. // $rows[]=$row;
  116. $item=array(
  117. 'license_plate'=>$val['PLATE_NO'],
  118. 'car_type'=>$val['CAR_TYPE'],
  119. 'brand_id'=>(int)$val['CAR_BRAND'],
  120. 'rfid_sn'=>$val['RFID_SN'],
  121. 'installer'=>$val['INSTALLER'],
  122. 'license_time'=>$val['INSTA_DATE'],
  123. );
  124. array_push($save_data,$item);
  125. }
  126. }
  127. $success = Db::table('stations')->limit(1000)->insertAll($save_data);
  128. oci_free_statement($stid);
  129. Cache::set('stationList', $rows, 300);
  130. $response=[
  131. 'code'=>10000,
  132. 'message'=>'查询成功',
  133. 'data'=>$rows,
  134. ];
  135. return $response;
  136. }
  137. /**
  138. * 所有列表给智能交通使用
  139. * @time 2022年01月20日 10:09
  140. * @param Request $request
  141. */
  142. public function getAllListForTrans(Request $request)
  143. {
  144. // $param=$request->param();
  145. // $cond['page']=isset($param['page'])?$param['page']:1;
  146. // $cond['limit']=isset($param['limit'])?$param['limit']:100;
  147. $cond['page']=1;
  148. $cond['limit']=30000;
  149. $conn = null;
  150. $tableName='(SELECT * FROM DSSC2.ADM_DEV ORDER BY ID DESC) a';
  151. $field='a.ID,a.LOGIN_NAME,a.DEVICE_CODE,a.DEVICE_NAME,a.OWNER_CODE';
  152. $host= Env::get('oracle.hostname', '127.0.0.1');
  153. $port= Env::get('oracle.hostport', '1521');
  154. $instance_name= Env::get('oracle.instance', 'ORCL');
  155. $username= Env::get('oracle.username', 'root');
  156. $password= Env::get('oracle.password', 'root');
  157. // $count=queryOracleCount('DSSC2.ADM_DEV',$cond);
  158. // $conn = oci_connect('用户名', '密码', '远程数据库名(eg.//192.168.1.133/orcl)');
  159. $conn = oci_connect($username, $password, $host.':'.$port.'/'. $instance_name,'AL32UTF8');
  160. if (!$conn) {
  161. $e = oci_error();
  162. trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
  163. }
  164. $start=($cond['page']-1)*$cond['limit'];
  165. $end=$cond['page']*$cond['limit'];
  166. $whereStr=buildQueryCond2($cond);
  167. $sql='SELECT * FROM ( SELECT '.$field.',ROWNUM RN FROM '.$tableName.' WHERE ROWNUM <='.$end.' '.$whereStr.' ) WHERE RN >'. $start;
  168. // var_dump($sql);
  169. // 查询并渲染
  170. $stid = oci_parse($conn, $sql);
  171. $r = oci_execute($stid);
  172. $rows=[];
  173. while($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
  174. $item=['key'=>$row['LOGIN_NAME'],'label'=>$row['DEVICE_NAME']];
  175. $rows[]=$item;
  176. }
  177. oci_free_statement($stid);
  178. // $response=[
  179. // 'code'=>10000,
  180. // 'message'=>'查询成功',
  181. // 'count'=>$count,
  182. // 'data'=>$rows,
  183. // 'current'=>isset($param['page'])?(int)$param['page']:1,
  184. // 'limit'=>isset($param['limit'])?(int)$param['limit']:100,
  185. // ];
  186. // return $response;
  187. $response=[
  188. 'code'=>10000,
  189. 'message'=>'查询成功',
  190. 'data'=>$rows,
  191. ];
  192. return $response;
  193. }
  194. /**
  195. * 保存信息
  196. * @time 2022年01月20日 10:55
  197. * @param Request $request
  198. */
  199. public function save(Request $request)
  200. {
  201. $params=$request->param();
  202. $params['LOGIN_NAME']=strtoupper($params['LOGIN_NAME']);
  203. $r=$this->execSaveStation($params);
  204. return CatchResponse::success($r);
  205. }
  206. private function execSaveStation($data){
  207. $conn=getOracleConnect();
  208. $sql='select DEVICE_CODE from "DSSC2"."ADM_DEV" where DEVICE_CODE in (select max(DEVICE_CODE) from "DSSC2"."ADM_DEV")';
  209. $stid = oci_parse($conn, $sql);
  210. $r = oci_execute($stid);
  211. $result = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS);
  212. $deivce_code=$result['DEVICE_CODE']+1;
  213. $time=date('Y-m-d H:i:s');
  214. //插入基站信息表
  215. $sql='INSERT INTO "DSSC2"."ADM_DEV"("ID", "DEVICE_CODE","DEVICE_NAME", "DEVICE_CATEGORY", "DEVICE_TYPE","OWNER_CODE","LOGIN_TYPE","LOGIN_NAME","IS_ONLINE","CREATE_DATE","UPDATE_DATE")
  216. VALUES(DSSC2.SEQ_ADM_DEV.nextval,\''.$deivce_code.'\',\''.$data['DEVICE_NAME'].'\',32,\'13\',\'001\',\'6\',\''.$data['LOGIN_NAME'].'\',0,TO_DATE(\''.$time.'\', \'SYYYY-MM-DD HH24:MI:SS\'),TO_DATE(\''.$time.'\', \'SYYYY-MM-DD HH24:MI:SS\'))';
  217. $stid = oci_parse($conn, $sql);
  218. $r = oci_execute($stid);
  219. //插入基站信息表
  220. $sql='INSERT INTO "DSSC2"."ADM_DEV_RFID_CHN"("ID", "DEVICE_CODE","CHANNEL_NAME", "STAT" ,"GPS_X","GPS_Y","TYPE")
  221. VALUES(DSSC2.SEQ_ADM_DEV_RFID_CHN.nextval,\''.$deivce_code.'\',\''.$data['DEVICE_NAME'].'\',1,\''.$data['longitude'].'\',\''.$data['latitude'].'\',1)';
  222. $stid = oci_parse($conn, $sql);
  223. $r = oci_execute($stid);
  224. oci_free_statement($stid);
  225. return $r;
  226. }
  227. /**
  228. * 更新
  229. * @time 2022年01月20日 10:55
  230. * @param Request $request
  231. * @param $id
  232. */
  233. public function update(Request $request, $id)
  234. {
  235. $params=$request->param();
  236. $params['LOGIN_NAME']=strtoupper($params['LOGIN_NAME']);
  237. //UPDATE DSSC2.ADM_DEV A SET A.DEVICE_NAME = '1014测试插入4' WHERE A.DEVICE_CODE = '79933';
  238. //UPDATE DSSC2.ADM_DEV_RFID_CHN A SET A.CHANNEL_NAME = '1014测试插入4' WHERE A.DEVICE_CODE ='79933';
  239. $conn=getOracleConnect();
  240. //更新
  241. $sql='UPDATE DSSC2.ADM_DEV SET DEVICE_NAME = \''.$params['DEVICE_NAME'].'\',LOGIN_NAME=\''.$params['LOGIN_NAME'].'\' WHERE DEVICE_CODE = \''.$id.'\' ';
  242. $stid = oci_parse($conn, $sql);
  243. $r = oci_execute($stid);
  244. $sql='UPDATE DSSC2.ADM_DEV_RFID_CHN SET CHANNEL_NAME = \''.$params['DEVICE_NAME'].'\',GPS_X='.$params['longitude'].',GPS_Y='.$params['latitude'].' WHERE DEVICE_CODE = \''.$id.'\' ';
  245. $stid2 = oci_parse($conn, $sql);
  246. $r2 = oci_execute($stid2);
  247. return CatchResponse::success('修改成功');
  248. }
  249. /**
  250. * 删除
  251. * @time 2022年01月20日 10:55
  252. * @param $id
  253. */
  254. public function delete($id) : \think\Response
  255. {
  256. // $ids=Utils::stringToArrayBy($id);
  257. $conn=getOracleConnect();
  258. $sql='DELETE FROM DSSC2.ADM_DEV WHERE DEVICE_CODE in ('.$id.')';
  259. $stid = oci_parse($conn, $sql);
  260. $r = oci_execute($stid);
  261. $sql='DELETE FROM DSSC2.ADM_DEV_RFID_CHN WHERE DEVICE_CODE in ('.$id.')';
  262. $stid = oci_parse($conn, $sql);
  263. $r = oci_execute($stid);
  264. return CatchResponse::success($r);
  265. }
  266. public function getdeviceListByStation(Request $request){
  267. $params=$request->param();
  268. if(!$params['station_code']){
  269. return CatchResponse::success('');
  270. }
  271. $cond=[];
  272. if($params['station_code']){
  273. $cond['RF_ID']=['=',$params['station_code']];
  274. }
  275. $start_time = date('Y-m-d 00:00:00',time());
  276. $end_time = date('Y-m-d 23:59:59',time());
  277. if(isset($params['timeRange']) && $params['timeRange'] != ''){
  278. $start_time=date('Y-m-d H:i:s',strtotime($params['timeRange'][0]));
  279. $end_time=date('Y-m-d H:i:s',strtotime($params['timeRange'][1]));
  280. $cond['RF_DATE']=['timeRange',$start_time,$end_time];
  281. }
  282. $count=queryOracleCount('DSSC2.W_DW_RF_RECORD',$cond);
  283. $cond['page']=isset($param['page'])?$param['page']:1;
  284. $cond['limit']=isset($param['limit'])?$param['limit']:10;
  285. $rows=queryOracleSelect('(SELECT * FROM DSSC2.W_DW_RF_RECORD ORDER BY RF_DATE DESC) a',$cond,'a.RF_FLAGID,a.RF_STAT,to_char(a.RF_DATE,\'yyyy-mm-dd hh24:mi:ss\') RF_DATE');
  286. foreach($rows as &$val){
  287. //状态: 0- 未知,1 - 进入,2 - 离开
  288. if($val['RF_STAT']==1){
  289. $val['RF_STAT_TEXT']='进入';
  290. }elseif($val['RF_STAT']==2){
  291. $val['RF_STAT_TEXT']='离开';
  292. }else{
  293. $val['RF_STAT_TEXT']='未知';
  294. }
  295. }
  296. $response=[
  297. 'code'=>10000,
  298. 'message'=>'查询成功',
  299. 'count'=>$count,
  300. 'data'=>$rows,
  301. 'current'=>isset($params['page'])?(int)$params['page']:1,
  302. 'limit'=>isset($params['limit'])?(int)$params['limit']:10,
  303. ];
  304. return $response;
  305. // $cond=[];
  306. // $params=$request->param();
  307. // if(!$params['station_code']){
  308. // return CatchResponse::success('');
  309. // }
  310. // if($params['station_code']){
  311. // $cond[]=['RF_ID','=',$params['station_code']];
  312. // }
  313. // $start_time = date('Y-m-d 00:00:00',time());
  314. // $end_time = date('Y-m-d 23:59:59',time());
  315. // if(isset($params['timeRange']) && $params['timeRange'] != ''){
  316. // $start_time=date('Y-m-d H:i:s',strtotime($params['timeRange'][0]));
  317. // $end_time=date('Y-m-d H:i:s',strtotime($params['timeRange'][1]));
  318. // $cond[]=['RF_DATE','between',[$start_time,$end_time]];
  319. // }
  320. // $list=$this->rfRecordModel->getList($cond);
  321. // return CatchResponse::paginate($list);
  322. }
  323. /**
  324. * 导入设备
  325. *
  326. * @time 2022年02月15日
  327. * @param Excel $excel
  328. * @param DeviceExport $deviceExport
  329. * @throws \PhpOffice\PhpSpreadsheet\Exception
  330. * @return \think\response\Json
  331. */
  332. public function importStation(Request $request)
  333. {
  334. $url = $request->post('url');
  335. if (!$url) {
  336. return CatchResponse::fail('请上传文件');
  337. }
  338. $creator_id = $request->post('creator_id');
  339. //解析地址
  340. $parse_url = parse_url($url)['path'];
  341. //载入excel表格
  342. $objPHPExcel = IOFactory::load(public_path() . $parse_url);
  343. //获取表名,一维数组,值是表名。如:array('sheet1', 'sheet2', 'sheet3')
  344. // $nameArr = $objPHPExcel->getSheetNames();
  345. //获取表的数量
  346. $sheetCount = $objPHPExcel->getSheetCount();
  347. $fail = 0; //失败条数
  348. $success = 0; //成功条数
  349. $total = 0; //总共设备数
  350. $data = []; //设备数据
  351. //循环读取每一张表
  352. for ($index = 0; $index < $sheetCount; $index++) {
  353. //设置当前要读取的表
  354. $sheet = $objPHPExcel->getSheet($index); //excel中的第一张sheet
  355. // var_dump($sheet);exit;
  356. $highestRow = $sheet->getHighestRow(); // 取得总行数
  357. // var_dump($highestRow);
  358. if ($highestRow <= 1) {
  359. continue;
  360. }
  361. $total += $highestRow - 1;
  362. for ($j = 2; $j <= $highestRow; $j++) {
  363. $arr = array(); //每条设备信息
  364. $arr['LOGIN_NAME'] = strtoupper(trim($sheet->getCell("A" . $j)->getFormattedValue()));
  365. $arr['longitude'] = trim($sheet->getCell("B" . $j)->getFormattedValue());
  366. $arr['latitude'] = trim($sheet->getCell("C" . $j)->getFormattedValue());
  367. $arr['DEVICE_NAME'] = trim($sheet->getCell("D" . $j)->getFormattedValue());
  368. $r=$this->execSaveStation($arr);
  369. if($r){
  370. $success++;
  371. }else{
  372. $fail++;
  373. }
  374. // var_dump($arr);
  375. // array_push($data,$arr);
  376. }
  377. }
  378. // array_unique($data, SORT_REGULAR);
  379. // // var_dump($data);return CatchResponse::success();
  380. // $count = $this->deviceModel->limit(100)->insertAll($data);
  381. // if ($success = $count) {
  382. return CatchResponse::success('共' . $total . '条数据,成功' . $success . '条,失败' . $fail . '条');
  383. // }
  384. // return CatchResponse::success(['error' => true, 'msg' => '导入失败']);
  385. }
  386. /**
  387. * Add
  388. * @time 2022年01月20日 10:09
  389. * @param Request $request
  390. */
  391. public function addAllStationToMysql(Request $request)
  392. {
  393. $cond=[
  394. '_string'=>'a.DEVICE_CODE = r.DEVICE_CODE',
  395. ];
  396. $cond['page']=1;
  397. $cond['limit']=30000;
  398. $conn = null;
  399. $tableName='(SELECT * FROM DSSC2.ADM_DEV ORDER BY ID DESC) a,DSSC2.ADM_DEV_RFID_CHN r';
  400. $field='a.ID,a.IS_ONLINE,a.LOGIN_NAME,a.DEVICE_CODE,a.DEVICE_NAME,a.OWNER_CODE,to_char(a.UPDATE_DATE,\'yyyy-mm-dd hh24:mi:ss\') UPDATE_DATE,r.GPS_X,r.GPS_Y';
  401. $host= Env::get('oracle.hostname', '127.0.0.1');
  402. $port= Env::get('oracle.hostport', '1521');
  403. $instance_name= Env::get('oracle.instance', 'ORCL');
  404. $username= Env::get('oracle.username', 'root');
  405. $password= Env::get('oracle.password', 'root');
  406. // $conn = oci_connect('用户名', '密码', '远程数据库名(eg.//192.168.1.133/orcl)');
  407. $conn = oci_connect($username, $password, $host.':'.$port.'/'. $instance_name,'AL32UTF8');
  408. if (!$conn) {
  409. $e = oci_error();
  410. trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
  411. }
  412. $start=($cond['page']-1)*$cond['limit'];
  413. $end=$cond['page']*$cond['limit'];
  414. $whereStr=buildQueryCond2($cond);
  415. $sql='SELECT * FROM ( SELECT '.$field.',ROWNUM RN FROM '.$tableName.' WHERE ROWNUM <='.$end.' '.$whereStr.' ) WHERE RN >'. $start;
  416. $stid = oci_parse($conn, $sql);
  417. $r = oci_execute($stid);
  418. $save_data=[];
  419. while($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
  420. if($row['GPS_Y'] && $row['GPS_X']){
  421. // $wgsLoc = \algorithm\Geometry::wgsTOgcj((float)$row['GPS_Y'],(float)$row['GPS_X']);
  422. // $lngLat = \algorithm\Geometry::convertGcj02ToBd09($wgsLoc['lat'],$wgsLoc['lng']);
  423. // $row['GPS_X']=$lngLat['lng'];
  424. // $row['GPS_Y']=$lngLat['lat'];
  425. // $rows[]=$row;
  426. $item=array(
  427. 'mac'=>$row['LOGIN_NAME'],
  428. 'shortcode'=>$row['DEVICE_CODE'],
  429. 'name'=>$row['DEVICE_NAME'],
  430. 'longitude'=>$row['GPS_X'],
  431. 'latitude'=>$row['GPS_Y'],
  432. 'created_at'=>strtotime($row['UPDATE_DATE']),
  433. 'creator_id'=>$row['OWNER_CODE']
  434. );
  435. array_push($save_data,$item);
  436. }
  437. }
  438. $success = Db::table('stations')->limit(1000)->insertAll($save_data);
  439. oci_free_statement($stid);
  440. return [];
  441. }
  442. }