userractModel.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. class flow_userractClassModel extends flowModel
  3. {
  4. protected $flowcompanyidfieds = 'companyid';
  5. public function initModel()
  6. {
  7. $this->statearr = explode(',','<font color=blue>待执行</font>,<font color=green>生效中</font>,<font color=#888888>已终止</font>,<font color=red>已过期</font>');
  8. }
  9. public function flowrsreplace($rs)
  10. {
  11. $rs['state'] = $this->statearr[$rs['state']];
  12. return $rs;
  13. }
  14. public function updatestate()
  15. {
  16. $dt = $this->rock->date;
  17. $this->update("`state`=2", "`tqenddt` is not null and `tqenddt`<`enddt` and `tqenddt`<'$dt'");
  18. $this->update("`state`=1", "`startdt`<='$dt' and `enddt`>='$dt' and `tqenddt` is null");
  19. $this->update("`state`=3", "`enddt`<'$dt' and `tqenddt` is null");
  20. $this->update("`state`=0", "`startdt`>'$dt'");
  21. }
  22. protected function flowbillwhere($uid, $lx)
  23. {
  24. $this->updatestate();
  25. $table = '`[Q]userract` a left join `[Q]admin` b on a.uid=b.id';
  26. return array(
  27. 'where' => '',
  28. 'table' => $table,
  29. 'fields'=> 'a.*,b.deptname',
  30. 'orlikefields'=>'b.deptname',
  31. 'order' => 'a.`optdt` desc',
  32. 'asqom' => 'a.'
  33. );
  34. }
  35. }
粤ICP备19079148号