carmwxModel.php 842 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. //车辆维修
  3. class flow_carmwxClassModel 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. }
粤ICP备19079148号