浏览代码

no message

panghu 5 月之前
父节点
当前提交
7ccaee9223
共有 2 个文件被更改,包括 22 次插入 和 0 次删除
  1. 2 0
      app/Http/Controllers/AdminApi/SignContractController.php
  2. 20 0
      app/Models/SignRecord.php

+ 2 - 0
app/Http/Controllers/AdminApi/SignContractController.php

@@ -114,6 +114,7 @@ class SignContractController extends AdminController
                     'name' => '',
                 ];
             }
+            $psnInfo->initializeModel();
             //获取企业签署链接
             $orgInfo = SignRecord::where('sign_id',$value->{'id'})->where('authType','ORG')->select(['status','sign_url','id_no'])->first();
             if (!empty($orgInfo)){
@@ -126,6 +127,7 @@ class SignContractController extends AdminController
                     'name' => '',
                 ];
             }
+            $orgInfo->initializeModel();
             $value->{'psnInfo'} = $psnInfo;
             $value->{'orgInfo'} = $orgInfo;
             $value->initializeModel();

+ 20 - 0
app/Models/SignRecord.php

@@ -25,6 +25,26 @@ class SignRecord extends Model
     protected $table = 'sign_records';
 
 
+    private $statusEnum=[
+        0=>'文件生成中',
+        1=>'待签署',
+        2=>'已签署',
+        3=>'已撤销',
+        4=>'已拒签',
+        5=>'已过期',
+        7=>'已拒签',
+        10=>'签署失败',
+    ];
+
+    /**
+     * 序列化数据字典
+     */
+    function initializeModel(){
+        if($this->{'status'}!==null){
+            $this->{'status_str'}=empty($this->statusEnum[$this->{'status'}])?'无':$this->statusEnum[$this->{'status'}];
+        }
+    }
+
     /**
      * 为数组 / JSON 序列化准备日期。
      *