mode_godepotAction.php 913 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * 此文件是流程模块【godepot.仓库管理】对应控制器接口文件。
  4. */
  5. class mode_godepotClassAction extends inputAction{
  6. protected function savebefore($table, $arr, $id, $addbo){
  7. }
  8. protected function saveafter($table, $arr, $id, $addbo){
  9. $name = $arr['depotname'];
  10. m('goodm')->update("`custname`='$name'","`type`=3 and `custid`='$id'");//更新调拨单选择的仓库名称
  11. }
  12. //从新统计仓库下的物品
  13. public function retotalAjax()
  14. {
  15. $db1 = m('godepot');
  16. $db2 = m('goodss');
  17. $rows = $db1->getall('1=1');
  18. foreach($rows as $k=>$rs){
  19. $wpshu = 0;
  20. $sql = 'SELECT `aid`,sum(`count`) as stttso FROM `[Q]goodss` where `depotid`='.$rs['id'].' GROUP BY aid';
  21. $ros1 = $this->db->getall($sql);
  22. foreach($ros1 as $k1=>$rs1)if($rs1['stttso']>0)$wpshu++;
  23. $db1->update('`wpshu`='.$wpshu.'', $rs['id']);
  24. }
  25. }
  26. }
粤ICP备19079148号