|
|
@@ -101,8 +101,11 @@ class OrderMainDao |
|
|
|
$statusList['isPayment']++; |
|
|
|
} |
|
|
|
} |
|
|
|
$orderInfo = $this->getInfoById($orderId); |
|
|
|
$orderStatus = $this->getStatus($cnt,$statusList,$orderInfo); |
|
|
|
$orderInfoRe = $this->getInfoById($orderId); |
|
|
|
if (!$orderInfoRe['flag']) { |
|
|
|
return $orderInfoRe; |
|
|
|
} |
|
|
|
$orderStatus = $this->getStatus($cnt,$statusList,$orderInfoRe['data']); |
|
|
|
//更新金额 |
|
|
|
$orderMain = new OrderMain(); |
|
|
|
$orderMain->save(["total_amount" => $amount, "cost_amount" => $cost,"profit_amount"=>$amount-$cost,"order_status"=>$orderStatus],["id" => $orderId]); |
|
|
@@ -122,7 +125,6 @@ class OrderMainDao |
|
|
|
public function getStatus($cnt,$statusList,$orderInfo){ |
|
|
|
//资源单状态 1、未发单/ 2已发单、3已确认、4已取消 |
|
|
|
//订单状态0待处理 1已确认 2部分取消 3处理中 10已完成 11已取消 |
|
|
|
|
|
|
|
//已完成:订单已完成付款、已完成收款(无视子订单状态) |
|
|
|
if ($orderInfo['receipt_order_status'] ==2 && $statusList['isPayment'] == $cnt) { |
|
|
|
return 10; |
|
|
@@ -293,4 +295,27 @@ class OrderMainDao |
|
|
|
return Util::returnArrEr("将主订单从收款单下移除失败".$e->getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取收款单下所有主订单的订单ID |
|
|
|
* @param $receipt_order_id |
|
|
|
* @return array |
|
|
|
*/ |
|
|
|
public function getOrderMainIdsByReceipt($receipt_order_id){ |
|
|
|
$orderModel = new OrderMain(); |
|
|
|
try { |
|
|
|
$subOrderList = $orderModel->where(["receipt_order_id" => $receipt_order_id, "del_flag" => 0])->select()->toArray(); |
|
|
|
if (null == $subOrderList) { |
|
|
|
return []; |
|
|
|
} |
|
|
|
|
|
|
|
$id = []; |
|
|
|
foreach ($subOrderList as $val){ |
|
|
|
$id[] = $val['id']; |
|
|
|
} |
|
|
|
return array_unique($id); |
|
|
|
}catch (Exception $e) { |
|
|
|
return []; |
|
|
|
} |
|
|
|
} |
|
|
|
} |