xieruidong 2 år sedan
förälder
incheckning
99c55c1b30
1 ändrade filer med 13 tillägg och 8 borttagningar
  1. 13 8
      application/common/service/OrderContractSvc.php

+ 13 - 8
application/common/service/OrderContractSvc.php

@@ -30,14 +30,19 @@ class OrderContractSvc{
     public function render(){
         $content=redis()->hGet('order_contract',$this->getOrder()->id)?:'';
         if(!$content){
-            $content=View::instance()
-                ->config('view_path',APP_PATH.'contract/view/')
-                ->fetch('show',[
-                    'order'=>$this->getOrder(),
-                    'no'=>sprintf('PK%s%02d',date('YmdHis'),$this->getOrder()->id),
-                    'tax_name'=>$this->taxName(),
-                    'tax_no'=>$this->getTaxNo(),
-                ]);
+            try {
+                $content=View::instance()
+                    ->config('view_path',APP_PATH.'contract/view/')
+                    ->fetch('show',[
+                        'order'=>$this->getOrder(),
+                        'no'=>sprintf('PK%s%02d',date('YmdHis'),$this->getOrder()->id),
+                        'tax_name'=>$this->taxName(),
+                        'tax_no'=>$this->getTaxNo(),
+                    ]);
+            }catch (\Exception $e){
+                $content='';
+            }
+
             redis()->hSet('order_contract',$this->getOrder()->id,$content);
         }