caigouModel.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. /*
  13. m('goodss')->update('status='.$zt.'',"`mid`='$this->id'");
  14. $aid = '0';
  15. $rows = m('goodss')->getall("`mid`='$this->id'",'aid');
  16. foreach($rows as $k=>$rs)$aid.=','.$rs['aid'].'';
  17. m('goods')->setstock($aid);
  18. */
  19. }
  20. //作废或删除时
  21. protected function flowzuofeibill($sm)
  22. {
  23. //删除入库详情的
  24. m('goodss')->delete("`mid`='$this->id'");
  25. }
  26. //子表数据替换处理
  27. protected function flowsubdata($rows, $lx=0){
  28. $db = m('goods');
  29. foreach($rows as $k=>$rs){
  30. $one = $db->getone($rs['aid']);
  31. if($one){
  32. $name = $one['name'];
  33. if(!isempt($one['xinghao']))$name.='('.$one['xinghao'].')';
  34. if($lx==1)$rows[$k]['aid'] = $name; //1展示时
  35. $rows[$k]['temp_aid'] = $name;
  36. }
  37. }
  38. return $rows;
  39. }
  40. //$lx,0默认,1详情展示,2列表显示
  41. public function flowrsreplace($rs, $lx=0)
  42. {
  43. $rs['states']= $rs['state'];
  44. $rs['state'] = $this->goodsobj->crkstate($rs['state']);
  45. //读取物品
  46. if($lx==2){
  47. $rs['wupinlist'] = $this->goodsobj->getgoodninfo($rs['id'], 1);
  48. }
  49. return $rs;
  50. }
  51. }
粤ICP备19079148号