Просмотр исходного кода

Merge branch 'yang' of ssh://was.baoshi56.com:10022/var/git/bswas

LD 4 лет назад
Родитель
Сommit
c3ab5eb15c

+ 3 - 3
app/Services/NewOrderCountingRecordService.php

@@ -381,7 +381,7 @@ class NewOrderCountingRecordService
                 'logistic_id' => $order->logistic_id,
                 'date_target' => $order->date_target,
                 'counting_unit' => $unit,
-                'amount' => $order->amounts,
+                'amount' => $order->amounts??0,
                 'week' => $year . '-' . $week,
                 'month' => $year . '-' . $month,
                 'year' => $year . '',
@@ -574,7 +574,7 @@ class NewOrderCountingRecordService
                 ->groupBy('date_target')
                 ->first();
             $orderCountingRecords[] = [
-                "counter" => $order->amounts,
+                "counter" => $order->amounts??0,
                 "date_target" => $order->date_target,
             ];
         }
@@ -638,7 +638,7 @@ class NewOrderCountingRecordService
                 'logistic_id' => $order->logistic_id,
                 'date_target' => $order->date_target,
                 'counting_unit' => $unit,
-                'amount' => $order->amounts,
+                'amount' => $order->amounts??0,
                 'year' => Carbon::parse($order->date_target)->year,
                 'month' => Carbon::parse($order->date_target)->year . '-' . Carbon::parse($order->date_target)->month,
             ];

+ 1 - 1
app/Services/OrderPackageReceivedSyncService.php

@@ -41,7 +41,7 @@ class OrderPackageReceivedSyncService
             $query = $query->where('sent_at', '>=', $initDate->subDays((int)config('api_logistic.days'))->toDateTimeString())
                 ->whereNull('received_at');
         } else {//查询20天以内的数据
-            $query = $query->whereDate('sent_at','2021-06-02')
+            $query = $query->where('sent_at', '>=', now()->subDays(20))
                 ->whereNull('received_at');
         }
         $query->chunk(2000, function ($orderPackages) {