示例#1
0
 public function updUnusualSkuConfirmQty($data)
 {
     $skuact = new SkuAct();
     $purorder = new PurchaseOrderAct();
     if (!empty($data)) {
         foreach ($data as $k => $v) {
             $id = $v['id'];
             $sku = $v['sku'];
             $status = $v['status'];
             $totalAmount = $v['totalAmount'];
             //总共到货数量
             $onWayAmount = $purorder->checkSkuOnWayNum($sku);
             //在途数量
             $waitOnAmount = $skuact->getTallySkuNum($sku);
             //等待上架数量
             $waitOnAmount = !empty($waitOnAmount) ? $waitOnAmount : 0;
             $confirmAmount = $totalAmount + $waitOnAmount - $onWayAmount;
             if ($status == 0) {
                 PurToWhModel::updUnusualSkuConfirmQty($id, $confirmAmount);
                 //重新计算待确认数量
             }
         }
     }
 }