Commit 5db27eb7 authored by hangjun83's avatar hangjun83

罗恩测试工具

parent e4d9fc08
......@@ -2,6 +2,7 @@
namespace App\TestTools\Rhawn;
use App\Rhawn\Repositories\Eloquent\RhawnSoitemsRepositoryEloquent;
use App\Rhawn\Repositories\Eloquent\RhawnSordersRepositoryEloquent;
use App\Rhawn\Services\RhawnCustomerService;
use App\Support\Facades\SimpleLogs;
......@@ -27,7 +28,7 @@ class RhawnToolsService
if($orderList) {
$armedOrders = [];
foreach ($orderList as $order) {
if ($order['so_review_status'] == 0) {
if ($order->so_review_status == 0) {
array_push($armedOrders, $order);
}
}
......@@ -38,9 +39,10 @@ class RhawnToolsService
//处理状态0的订单
if (count($armedOrders) > 0) {
foreach ($armedOrders as $order) {
$orderDetail = $this->rhawnOrdersService->getCustomerOrderItemsByOrderId($customer['cus_id'], $order['so_id']);
if ($orderDetail) {
foreach ($orderDetail as $detail) {
$itemRepository = app(RhawnSoitemsRepositoryEloquent::class);
$items = $itemRepository->getSorderItemsDetailFromOrderId($order->so_id);
if ($items) {
foreach ($items as $detail) {
$si_discount = 0;
$si_amount = 0;
if ($detail['p_id'] > 0) {
......@@ -56,7 +58,7 @@ class RhawnToolsService
}
//更新订单总价
$total = $connection->table('soitems')
->where('so_id',$order['so_id'])
->where('so_id',$order->so_id)
->select(DB::raw('sum(si_amount) as amount'))
->get();
var_dump($total);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment