1
0

tuihuoModel.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. //退货
  3. class flow_tuihuoClassModel extends flowModel
  4. {
  5. public $minwidth = 600;//子表最小宽
  6. public function initModel()
  7. {
  8. $this->goodsobj = m('goods');
  9. $this->cangobj = m('godepot');
  10. }
  11. //审核完成处理,要通知仓库管理员出入库
  12. protected function flowcheckfinsh($zt){
  13. }
  14. //子表数据替换处理
  15. protected function flowsubdata($rows, $lx=0){
  16. $db = m('goods');
  17. foreach($rows as $k=>$rs){
  18. $one = $db->getone($rs['aid']);
  19. if($one){
  20. $name = $one['name'];
  21. if(!isempt($one['xinghao']))$name.='('.$one['xinghao'].')';
  22. if($lx==1)$rows[$k]['aid'] = $name; //1展示时
  23. $rows[$k]['temp_aid'] = $name;
  24. }
  25. }
  26. return $rows;
  27. }
  28. //$lx,0默认,1详情展示,2列表显示
  29. public function flowrsreplace($rs,$lx=0)
  30. {
  31. $rs['states']= $rs['state'];
  32. $rs['state'] = $this->goodsobj->crkstate($rs['state']);
  33. $custractid = (int)$rs['custractid'];
  34. if($custractid>0){
  35. $htrs = $this->getone('`id`='.$custractid.'');
  36. if($htrs){
  37. $custractid = $htrs['num'];//读取关联销售
  38. if($lx==1)$custractid = '<a href="'.$this->getxiangurl('custxiao',$rs['custractid'],'auto').'">'.$custractid.'</a>';
  39. }else{
  40. $custractid = 0;//不存在
  41. $this->update('`custractid`='.$custractid.'', $rs['id']);
  42. }
  43. }
  44. if($custractid===0){
  45. $custractid = '<font color=#aaaaaa>无关联</a>';
  46. }
  47. $rs['custractid'] = $custractid;
  48. //读取物品
  49. if($lx==2){
  50. $rs['wupinlist'] = $this->goodsobj->getgoodninfo($rs['id'], 1);
  51. }
  52. return $rs;
  53. }
  54. }
粤ICP备19079148号