Browse Source

删除子订单

dev
nizongfeng 3 years ago
parent
commit
fd2cf7c252
3 changed files with 24 additions and 0 deletions
  1. +6
    -0
      application/admin/service/OrderMainService.php
  2. +9
    -0
      application/admin/service/PurchaseDao.php
  3. +9
    -0
      application/admin/service/PurchasePriceDao.php

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

@@ -196,6 +196,12 @@ class OrderMainService
$subOrderDao = new OrderItemDao();
}
$subOrderDao->delById($param['id']);
//删除采购单
$purchaseDao = new PurchaseDao();
$purchaseDao->deleteBySubOrderId($param['id']);
//删除每日采购单价格
$purchasePriceDao = new PurchasePriceDao();
$purchasePriceDao->deleteBySubOrderId($param['id']);
return Util::returnArrSu();
}catch (Exception $e){
return Util::returnArrEr("删除子订单失败".$e->getMessage());


+ 9
- 0
application/admin/service/PurchaseDao.php View File

@@ -123,4 +123,13 @@ class PurchaseDao
$model = new Purchase();
$model->save(["del_flag"=>1],["order_id"=>$order_id]);
}

/**
* 删除子订单
* @param $subOrderId
*/
public function deleteBySubOrderId($subOrderId) {
$model = new Purchase();
$model->save(["del_flag"=>1],["order_detail_id"=>$subOrderId]);
}
}

+ 9
- 0
application/admin/service/PurchasePriceDao.php View File

@@ -65,4 +65,13 @@ class PurchasePriceDao
$model = new PurchasePrice();
$model->save(["del_flag" => 1], ["purchase_id" => $purchase_id]);
}

/**
* 删除子订单对于的每日价格
* @param $subOrderId
*/
public function deleteBySubOrderId($subOrderId) {
$model = new PurchasePrice();
$model->save(["del_flag" => 1], ["order_detail_id" => $subOrderId]);
}
}

Loading…
Cancel
Save