kqdwModel.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. class flow_kqdwClassModel extends flowModel
  3. {
  4. protected $flowcompanyidfieds = 'uid'; //多单位用这个关联
  5. public function initModel()
  6. {
  7. $this->dateobj = c('date');
  8. $this->typearr = explode(',','普通,事件,企业微信定位');
  9. }
  10. //打开详情时跳转到地理位置显示
  11. protected function flowchangedata()
  12. {
  13. if(!isajax() && !isempt($this->rs['location_x'])){
  14. $url = 'index.php?m=kaoqin&a=location&d=main&id='.$this->id.'';
  15. $this->rock->location($url);
  16. exit();
  17. }
  18. }
  19. /**
  20. * 显示条件过滤
  21. */
  22. protected function flowbillwhere($uid, $lx)
  23. {
  24. $atype = $lx;
  25. $dt1 = $this->rock->post('dt1');
  26. $dt2 = $this->rock->post('dt2');
  27. $key = $this->rock->post('key');
  28. $s = '';
  29. $s = ' and b.id='.$this->adminid.'';
  30. //全部下属打卡
  31. if($lx=='down'){
  32. $s = 'and '.$this->adminmodel->getdownwheres('b.id', $uid, 0);
  33. }
  34. if($atype=='all')$s ='';
  35. if(!isempt($dt1))$s.=" and a.`optdt`>='$dt1'";
  36. if(!isempt($dt2))$s.=" and a.`optdt`<='$dt2 23:59:59'";
  37. if(!isempt($key))$s.=" and (b.`name` like '%$key%' or b.`deptallname` like '%$key%' or b.`ranking` like '%$key%')";
  38. $fields = 'a.*,b.name,b.deptname';
  39. $tabls = $this->mtable;
  40. $table = '`[Q]'.$tabls.'` a left join `[Q]userinfo` b on a.uid=b.id';
  41. return array(
  42. 'where' => $s,
  43. 'table' => $table,
  44. 'order' => 'a.`id` desc',
  45. 'fields'=> $fields
  46. );
  47. }
  48. //替换
  49. public function flowrsreplace($rs, $lx=0)
  50. {
  51. $week = $this->dateobj->cnweek($rs['optdt']);
  52. $rs['week'] = $week;
  53. if($week=='六' || $week=='日')$rs['ishui']= 1;
  54. $rs['type']= arrvalue($this->typearr, $rs['type']);
  55. return $rs;
  56. }
  57. }
粤ICP备19079148号