indexAction.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <?php
  2. class indexClassAction extends apiAction
  3. {
  4. public function indexAction()
  5. {
  6. $this->showreturn('','error', 203);
  7. }
  8. /**
  9. * 手机app读取
  10. */
  11. public function indexinitAction()
  12. {
  13. $dbs = m('reim');
  14. $ntime = floatval($this->post('ntime'));
  15. $uid = $this->adminid;
  16. $arr['loaddt'] = $this->now;
  17. $arr['splittime'] = (int)($ntime/1000-time());
  18. $arr['reimarr'] = $dbs->gethistory($uid);
  19. $this->showreturn($arr);
  20. }
  21. /**
  22. * app首页接口截止
  23. */
  24. public function indexappAction()
  25. {
  26. $dbs = m('reim');
  27. $ntime = floatval($this->post('ntime'));
  28. $uid = $this->adminid;
  29. $agent = $dbs->getappagent($uid);
  30. $arr['loaddt'] = $this->now;
  31. $arr['splittime'] = (int)($ntime/1000-time());
  32. $arr['reimarr'] = $dbs->gethistory($uid);
  33. $arr['agentarr'] = $agent['rows'];
  34. $arr['agentstotal'] = $agent['stotal'];
  35. $arr['maxupsize'] = c('upfile')->getmaxzhao();//最大上传大小M
  36. $arr['appversion'] = $this->get('appversion');
  37. $arr['xinhuver'] = VERSION;
  38. $arr['wsconfig'] = $dbs->getreims();
  39. $this->showreturn($arr);
  40. }
  41. public function lunxunAction()
  42. {
  43. $uid = $this->adminid;
  44. $loaddt = $this->post('loaddt');
  45. //$reimarr = m('reim')->getwdarr($uid, $loaddt);
  46. $reimarr = m('reim')->gethistory($uid, $loaddt);
  47. $arr['reimarr'] = $reimarr;
  48. $arr['loaddt'] = $this->now;
  49. m('login')->uplastdt();
  50. $this->showreturn($arr);
  51. }
  52. //应用获取数据
  53. public function getyydataAction()
  54. {
  55. $num = $this->post('num');
  56. $event = $this->post('event');
  57. $page = (int)$this->post('page');
  58. $rows = m('agent:'.$num.'')->getdata($this->adminid, $num, $event, $page);
  59. $this->showreturn($rows);
  60. }
  61. public function yyoptmenuAction()
  62. {
  63. $num = $this->post('modenum');
  64. $sm = $this->post('sm');
  65. $optid = (int)$this->post('optmenuid');
  66. $zt = (int)$this->post('statusvalue');
  67. $mid = (int)$this->post('mid');
  68. $msg = m('flow')->opt('optmenu', $num, $mid, $optid, $zt, $sm);
  69. if($msg != 'ok')$this->showreturn('', $msg, 201);
  70. $this->showreturn('');
  71. }
  72. public function changetxAction()
  73. {
  74. $apptx = (int)$this->post('apptx');
  75. m('admin')->update("`apptx`='$apptx'", $this->adminid);
  76. $this->showreturn('');
  77. }
  78. public function checkewmAction()
  79. {
  80. $randkey = $this->get('randkey');
  81. $lx = (int)$this->get('lx');
  82. $val = $this->adminid;
  83. $lxarr = array('已取消','已确认');
  84. if($lx==0)$val='-1';
  85. c('cache')->set($randkey,$val,60);
  86. $this->showreturn($lxarr[$lx]);
  87. }
  88. /**
  89. * 切换公司
  90. */
  91. public function changecompanyAction()
  92. {
  93. $id = (int)$this->get('id');
  94. $db = m('admin');
  95. $db->update('comid='.$id.'', '`id`='.$this->adminid.'');
  96. $db->getcompanyinfo();
  97. return returnsuccess();
  98. }
  99. public function getcompanyAction()
  100. {
  101. $carr = m('admin')->getcompanyinfo($this->adminid);
  102. $this->showreturn($carr);
  103. }
  104. /**
  105. * 华为设置客户端token
  106. */
  107. public function updateTokenIpAction()
  108. {
  109. $hwtoken = $this->get('hwtoken');
  110. $pushtoken = $this->get('pushtoken');
  111. $ispush = (int)$this->get('ispush','0');
  112. $uarr['ispush'] = $ispush;
  113. $uarr['pushtoken'] = $pushtoken;
  114. $uarr['moddt'] = $this->now;
  115. if(!isempt($hwtoken))$uarr['ip'] = $hwtoken;
  116. m('login')->update($uarr, "`token`='$this->admintoken'");
  117. if($ispush==1)m('reim')->sendpush($this->adminid, 'all', array(
  118. 'type' => 'onoffline',
  119. 'online' => 2
  120. ));
  121. return returnsuccess();
  122. }
  123. public function addlogAction()
  124. {
  125. $tit = $this->post('title');
  126. $cont = $this->post('cont');
  127. $web = $this->post('web');
  128. $level = (int)$this->post('level','0');
  129. m('log')->addlogs($tit, $cont,$level, array(
  130. 'web' => $web,
  131. ));
  132. return returnsuccess();
  133. }
  134. public function sgstrs()
  135. {
  136. }
  137. }