Browse Source

金额统计

dev
nizongfeng 3 years ago
parent
commit
2e31ab2ad6
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      application/admin/service/OrderMainDao.php
  2. +1
    -1
      application/admin/service/PurchaseDao.php

+ 1
- 1
application/admin/service/OrderMainDao.php View File

@@ -72,7 +72,7 @@ class OrderMainDao
}
//更新金额
$orderMain = new OrderMain();
$orderMain->save(["total_amount" => $amount, "cost_amount" => $cost],["id" => $orderId]);
$orderMain->save(["total_amount" => $amount, "cost_amount" => $cost,"profit_amount"=>$amount-$cost],["id" => $orderId]);
return Util::returnArrSu();
}catch (Exception $e){
return Util::returnArrEr("更新主表订单金额失败:".$e->getMessage());


+ 1
- 1
application/admin/service/PurchaseDao.php View File

@@ -109,7 +109,7 @@ class PurchaseDao
$cnt += $price['count'];
}
$purchase = new Purchase();
$purchase->save(["total_price"=>$amount,"total_cost"=>$cost,"count"=>$cnt],["id"=>$purchaseId]);
$purchase->save(["total_price"=>$amount,"total_cost"=>$cost,"count"=>$cnt,"profit"=>$amount-$cost],["id"=>$purchaseId]);
return Util::returnArrSu();
}catch (Exception $e){
return Util::returnArrEr("更新采购单金额失败:".$e->getMessage());


Loading…
Cancel
Save