caigouModel.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. class flow_caigouClassModel extends flowModel
  3. {
  4. public $minwidth = 600;//子表最小宽
  5. private $goodsobj;
  6. public function initModel()
  7. {
  8. $this->goodsobj = m('goods');
  9. }
  10. //审核完成处理,是否直接出入库
  11. protected function flowcheckfinsh($zt){
  12. if($zt==1)m('goods')->chukuopts($this->id, $this->modename);
  13. }
  14. //作废或删除时
  15. protected function flowzuofeibill($sm)
  16. {
  17. //删除入库详情的
  18. m('goodss')->delete("`mid`='$this->id'");
  19. }
  20. //子表数据替换处理
  21. protected function flowsubdata($rows, $lx=0){
  22. $db = m('goods');
  23. foreach($rows as $k=>$rs){
  24. $one = $db->getone($rs['aid']);
  25. if($one){
  26. $name = $one['name'];
  27. if(!isempt($one['xinghao']))$name.='('.$one['xinghao'].')';
  28. if($lx==1)$rows[$k]['aid'] = $name; //1展示时
  29. $rows[$k]['temp_aid'] = $name;
  30. }
  31. }
  32. return $rows;
  33. }
  34. //$lx,0默认,1详情展示,2列表显示
  35. public function flowrsreplace($rs, $lx=0)
  36. {
  37. $rs['states']= $rs['state'];
  38. $rs['state'] = $this->goodsobj->crkstate($rs['state']);
  39. //读取物品
  40. if($lx==2){
  41. $rs['wupinlist'] = $this->goodsobj->getgoodninfo($rs['id'], 1);
  42. }
  43. return $rs;
  44. }
  45. }
粤ICP备19079148号