|
|
@@ -105,10 +105,27 @@ class OrderMainDao |
|
|
|
if (!$orderInfoRe['flag']) { |
|
|
|
return $orderInfoRe; |
|
|
|
} |
|
|
|
$orderStatus = $this->getStatus($cnt,$statusList,$orderInfoRe['data']); |
|
|
|
$orderInfo = $orderInfoRe['data']; |
|
|
|
$orderStatus = $this->getStatus($cnt,$statusList,$orderInfo); |
|
|
|
$saveVal = [ |
|
|
|
"total_amount" => $amount, |
|
|
|
"cost_amount" => $cost, |
|
|
|
"profit_amount"=>$amount-$cost, |
|
|
|
"order_status"=>$orderStatus, |
|
|
|
"success_time"=>null, |
|
|
|
"cancel_time"=>null |
|
|
|
]; |
|
|
|
if ($orderStatus != $orderInfo["order_status"]) { |
|
|
|
if ($orderStatus==10) { |
|
|
|
$saveVal["success_time"] = date("Y-m-d H:i:s"); |
|
|
|
} |
|
|
|
if ($orderStatus == 11 ) { |
|
|
|
$saveVal['cancel_time'] = date("Y-m-d H:m:s"); |
|
|
|
} |
|
|
|
} |
|
|
|
//更新金额 |
|
|
|
$orderMain = new OrderMain(); |
|
|
|
$orderMain->save(["total_amount" => $amount, "cost_amount" => $cost,"profit_amount"=>$amount-$cost,"order_status"=>$orderStatus],["id" => $orderId]); |
|
|
|
$orderMain->save($saveVal,["id" => $orderId]); |
|
|
|
return Util::returnArrSu(); |
|
|
|
}catch (Exception $e){ |
|
|
|
return Util::returnArrEr("更新主表订单金额失败:".$e->getMessage()); |
|
|
|