carmbyModel.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. //车辆保养
  3. class flow_carmbyClassModel extends flowModel
  4. {
  5. public function flowrsreplace($rs)
  6. {
  7. if(isset($rs['carnum'])){
  8. $ors = $rs;
  9. }else{
  10. $ors = m('carm')->getone($rs['carid']);
  11. }
  12. if($ors)$rs['carid'] = ''.$ors['carbrand'].','.$ors['carmode'].'('.$ors['carnum'].')';
  13. return $rs;
  14. }
  15. //多个连表查询
  16. public function flowbillwhere($uid, $lx)
  17. {
  18. return array(
  19. 'table' => '`[Q]'.$this->mtable.'` a left join `[Q]carm` b on a.carid=b.id left join `[Q]flow_bill` c on c.`table`=\''.$this->mtable.'\' and c.mid=a.id',
  20. 'fields' => 'a.*,b.carnum,b.carbrand,b.carmode,cartype,c.uname as base_name,c.udeptname as base_deptname',
  21. 'orlikefields' => 'b.carnum,b.carbrand,b.carmode,b.`cartype`,c.`udeptname`,c.`uname`,c.`sericnum`@1',
  22. 'asqom' => 'a.'
  23. );
  24. }
  25. //自定义审核人读取
  26. protected function flowcheckname($num){
  27. $sid = '';
  28. $sna = '';
  29. //驾驶员审核读取
  30. if($num=='jia'){
  31. $sid = $this->rs['jiaid'];
  32. $sna = $this->rs['jianame'];
  33. }
  34. return array($sid, $sna);
  35. }
  36. }
粤ICP备19079148号