Commit 5db27eb7 authored by hangjun83's avatar hangjun83

罗恩测试工具

parent e4d9fc08
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace App\TestTools\Rhawn; namespace App\TestTools\Rhawn;
use App\Rhawn\Repositories\Eloquent\RhawnSoitemsRepositoryEloquent;
use App\Rhawn\Repositories\Eloquent\RhawnSordersRepositoryEloquent; use App\Rhawn\Repositories\Eloquent\RhawnSordersRepositoryEloquent;
use App\Rhawn\Services\RhawnCustomerService; use App\Rhawn\Services\RhawnCustomerService;
use App\Support\Facades\SimpleLogs; use App\Support\Facades\SimpleLogs;
...@@ -27,7 +28,7 @@ class RhawnToolsService ...@@ -27,7 +28,7 @@ class RhawnToolsService
if($orderList) { if($orderList) {
$armedOrders = []; $armedOrders = [];
foreach ($orderList as $order) { foreach ($orderList as $order) {
if ($order['so_review_status'] == 0) { if ($order->so_review_status == 0) {
array_push($armedOrders, $order); array_push($armedOrders, $order);
} }
} }
...@@ -38,9 +39,10 @@ class RhawnToolsService ...@@ -38,9 +39,10 @@ class RhawnToolsService
//处理状态0的订单 //处理状态0的订单
if (count($armedOrders) > 0) { if (count($armedOrders) > 0) {
foreach ($armedOrders as $order) { foreach ($armedOrders as $order) {
$orderDetail = $this->rhawnOrdersService->getCustomerOrderItemsByOrderId($customer['cus_id'], $order['so_id']); $itemRepository = app(RhawnSoitemsRepositoryEloquent::class);
if ($orderDetail) { $items = $itemRepository->getSorderItemsDetailFromOrderId($order->so_id);
foreach ($orderDetail as $detail) { if ($items) {
foreach ($items as $detail) {
$si_discount = 0; $si_discount = 0;
$si_amount = 0; $si_amount = 0;
if ($detail['p_id'] > 0) { if ($detail['p_id'] > 0) {
...@@ -56,7 +58,7 @@ class RhawnToolsService ...@@ -56,7 +58,7 @@ class RhawnToolsService
} }
//更新订单总价 //更新订单总价
$total = $connection->table('soitems') $total = $connection->table('soitems')
->where('so_id',$order['so_id']) ->where('so_id',$order->so_id)
->select(DB::raw('sum(si_amount) as amount')) ->select(DB::raw('sum(si_amount) as amount'))
->get(); ->get();
var_dump($total); 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