1
0

kaoqinAction.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. }
粤ICP备19079148号