caigouModel.php 1.3 KB

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