|
@@ -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);
|
|
|
}
|
|
|
|