kaoqinAction.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. class kaoqinClassAction extends apiAction
  3. {
  4. public function adddkjlAction()
  5. {
  6. $mac = $this->post('mac');
  7. $ip = $this->post('ip');
  8. $msg = m('kaoqin')->adddkjl($this->adminid,0,'',$ip,$mac);
  9. if($msg!='')$this->showreturn('', $msg, 201);
  10. $this->showreturn($this->now);
  11. }
  12. public function getshangAction()
  13. {
  14. $kq = m('kaoqin');
  15. $dt = $this->rock->date;
  16. $sbarr = $kq->getsbanay($this->adminid, $dt);
  17. $dkarr = $kq->getdkjl($this->adminid, $dt);
  18. $barr['sbarr'] = $sbarr;
  19. $barr['dkarr'] = $dkarr;
  20. $this->showreturn($barr);
  21. }
  22. public function getpaibAction()
  23. {
  24. $barr = array();
  25. $month = $this->get('month');
  26. $uid = $this->get('uid', $this->adminid);
  27. $maxjg = c('date')->getmaxdt($month);
  28. $kqobj = m('kaoqin');
  29. $ztarr = array();
  30. for($i=1;$i<=$maxjg;$i++){
  31. $oi = ($i<10) ? '0'.$i.'' : $i;
  32. $dt = $month.'-'.$oi;
  33. $zt = '';
  34. $iswork = $kqobj->isworkdt($uid, $dt);
  35. if($iswork==1){
  36. $zt = $kqobj->getdistid($uid, $dt);
  37. if(!in_array($zt, $ztarr))$ztarr[] = $zt;
  38. }
  39. $barr[$dt] = $zt;
  40. }
  41. $abc = '其中:';
  42. if($ztarr){
  43. $rows = m('kqsjgz')->getall('id in('.join(',', $ztarr).')');
  44. foreach($rows as $k=>$rs)$abc.='['.$rs['id'].']'.$rs['name'].';';
  45. }
  46. $barr['abc'] = $abc;
  47. $this->showreturn($barr);
  48. }
  49. /**
  50. * 获取定位的URL
  51. */
  52. //private $dwurl = 'http://127.0.0.1/app/rockfile/index.php?m=dingwei';
  53. private $dwurl = 'aHR0cHM6Ly9maWxlLnJvY2tvYS5jb20vaW5kZXgucGhwP209ZGluZ3dlaQ::';
  54. public function dwurlAction()
  55. {
  56. $dwrand = $this->get('dwrand');
  57. return returnsuccess(array(
  58. 'url' => $this->jm->base64decode($this->dwurl).'&dwrand='.$dwrand.'',
  59. 'dwrand' => $dwrand
  60. ));
  61. }
  62. public function dwgetAction()
  63. {
  64. $dwrand = $this->get('dwrand');
  65. $url = $this->jm->base64decode($this->dwurl).'&a=getdw&dwrand='.$dwrand.'';
  66. $cont = c('curl')->getcurl($url);
  67. if(!$cont)$cont = returnerror('无法获取');
  68. return $cont;
  69. }
  70. /**
  71. * 腾讯地图地址解析api.php?m=kaoqin&a=gcoder
  72. */
  73. public function gcoderAction()
  74. {
  75. return c('mapqq')->gcoder($this->get('lat'), $this->get('lng'));
  76. }
  77. //地址转化
  78. public function translateAction()
  79. {
  80. return c('mapqq')->translate($this->get('lat'), $this->get('lng'),(int)$this->get('type'));
  81. }
  82. //搜索
  83. public function suggestionAction()
  84. {
  85. return c('mapqq')->suggestion($this->get('key'));
  86. }
  87. }
粤ICP备19079148号