Browse Source

删除子订单 计算总金额

dev
nizongfeng 3 years ago
parent
commit
6365978471
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      application/admin/service/OrderMainService.php

+ 7
- 0
application/admin/service/OrderMainService.php View File

@@ -196,6 +196,10 @@ class OrderMainService
} else {
$subOrderDao = new OrderItemDao();
}
$subOrderRe = $subOrderDao->getInfoById($param['id']);
if (!$subOrderRe['flag']) {
return $subOrderRe;
}
$subOrderDao->delById($param['id']);
//删除采购单
$purchaseDao = new PurchaseDao();
@@ -203,6 +207,9 @@ class OrderMainService
//删除每日采购单价格
$purchasePriceDao = new PurchasePriceDao();
$purchasePriceDao->deleteBySubOrderId($param['id']);
//重新计算订单总金额
$orderMainDao = new OrderMainDao();
$orderMainDao->setOrderAmount($subOrderRe['data']['order_id']);
return Util::returnArrSu();
}catch (Exception $e){
return Util::returnArrEr("删除子订单失败:".$e->getMessage());


Loading…
Cancel
Save