mode_goodghAction.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * 此文件是流程模块【goodgh.物品归还】对应控制器接口文件。
  4. */
  5. class mode_goodghClassAction extends inputAction{
  6. protected function savebefore($table, $arr, $id, $addbo){
  7. //判断是否重复录入
  8. $custid = $arr['custid'];
  9. $to = m('goodm')->rows("`custid`='$custid' and `type`=4 and `status` in(0,1,2)");
  10. if($to>0)return '已经申请过物品归还,不要重复申请';
  11. $rows['type'] = '4';//一定要是4,不能去掉
  12. return array(
  13. 'rows'=>$rows
  14. );
  15. }
  16. protected function saveafter($table, $arr, $id, $addbo){
  17. }
  18. //读取需要归还的领用单
  19. public function getgoodly()
  20. {
  21. $rows = $this->db->getall('select a.`mid` from `[Q]goodn` a left join `[Q]goodm` b on a.mid=b.id where a.`lygh`=1 and b.`uid`='.$this->adminid.' and b.`status`=1 and b.`type`=0');
  22. $mid = '';
  23. $barr = array();
  24. if($rows){
  25. foreach($rows as $k=>$rs)$mid.=','.$rs['mid'].'';
  26. $barr = $this->db->getall('select a.`id` as `value`,b.`sericnum` as name from `[Q]goodm` a left join `[Q]flow_bill` b on a.`id`=b.`mid` and b.`table`=\'goodm\' where a.`id` in('.substr($mid,1).') and a.`uid`='.$this->adminid.'');
  27. }
  28. return $barr;
  29. }
  30. //ajax读取需要归还的子表
  31. public function getgoodnAjax()
  32. {
  33. $wmid= (int)$this->get('wmid','0');
  34. $rows = $this->db->getall("select a.`aid`,b.name as temp_aid,a.`count` from `[Q]goodn` a left join `[Q]goods` b on a.`aid`=b.`id` where a.`mid`='$wmid' and a.`lygh`=1");
  35. return $rows;
  36. }
  37. }
粤ICP备19079148号