1
0

tuihuoModel.php 1.6 KB

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