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

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

LD 5 лет назад
Родитель
Сommit
b974775be8

+ 1 - 8
app/Http/Controllers/TestController.php

@@ -166,14 +166,7 @@ class TestController extends Controller
 
     public function test()
     {
-        $error = [];
-        try{
-            $d = 0/0;
-            $this->a(null);
-        }catch (\Error|\Exception $e){
-            $error[] = "错了".$e->getMessage();
-        }
-        throw new \Exception(json_encode($error));
+        dd(json_encode(false));
         return view("test");
     }
     public function a(int $c)

+ 2 - 1
app/Jobs/OrderCreateInstantBill.php

@@ -7,6 +7,7 @@ use App\Services\OrderService;
 use Illuminate\Bus\Queueable;
 use Illuminate\Contracts\Queue\ShouldQueue;
 use Illuminate\Database\Eloquent\Collection;
+use Illuminate\Database\Eloquent\Model;
 use Illuminate\Foundation\Bus\Dispatchable;
 use Illuminate\Queue\InteractsWithQueue;
 
@@ -42,7 +43,7 @@ class OrderCreateInstantBill implements ShouldQueue
                     if (!$service->createInstantBill($order))
                         LogService::log(__METHOD__,"ERROR-订单生成即时账单",$order->toJson());
                 }catch (\Error|\Exception $e){
-                    LogService::log(__METHOD__,"ERROR-订单生成即时账单",$order->toJson()." | ".$e->getMessage());
+                    LogService::log(__METHOD__,"ERROR-订单生成即时账单",(is_subclass_of($order,Model::class) ? $order->toJson() : json_encode($order))." | ".$e->getMessage());
                     $errors = ["order_".$order->id.":".$e->getMessage()];
                 }
             }

+ 2 - 1
app/Jobs/StoreCreateInstantBill.php

@@ -7,6 +7,7 @@ use App\Services\StoreService;
 use Illuminate\Bus\Queueable;
 use Illuminate\Contracts\Queue\ShouldQueue;
 use Illuminate\Database\Eloquent\Collection;
+use Illuminate\Database\Eloquent\Model;
 use Illuminate\Foundation\Bus\Dispatchable;
 use Illuminate\Queue\InteractsWithQueue;
 
@@ -42,7 +43,7 @@ class StoreCreateInstantBill implements ShouldQueue
             try{
                 $service->createInstantBill($store);
             }catch (\Error|\Exception $e){
-                LogService::log(__METHOD__,"ERROR-入库生成即时账单",$store->toJson()." | ".$e->getMessage());
+                LogService::log(__METHOD__,"ERROR-入库生成即时账单",(is_subclass_of($store,Model::class) ? $store->toJson() : json_encode($this->stores))." | ".$e->getMessage());
                 $errors = ["store_".$store->id.":".$e->getMessage()];
             }
         }