Sfoglia il codice sorgente

流程和节点的列表中status字段转换为字符串,范围为1,0

wufeng 2 anni fa
parent
commit
29be4829e0
2 ha cambiato i file con 20 aggiunte e 8 eliminazioni
  1. 7 1
      app/admin/model/ActionProcess.php
  2. 13 7
      app/admin/model/Process.php

+ 7 - 1
app/admin/model/ActionProcess.php

@@ -33,10 +33,16 @@ class ActionProcess extends Model
     public static $operation_type_system = 2;//操作类型:2系统节点
 
     public static $status_normal = 1;//状态,1启用
-    public static $status_disable = 2;//状态,2禁用
+    public static $status_disable = 0;//状态,0禁用
 
     public static $is_del_normal = 0;//是否删除,0正常
     public static $is_deleted = 1;//是否删除,1删除
 
 
+    //数据类型转换
+    public function getStatusAttr($val)
+    {
+        return (string)$val;
+    }
+
 }

+ 13 - 7
app/admin/model/Process.php

@@ -7,15 +7,21 @@ use think\Model;
 //流程表
 class Process extends Model
 {
-    protected $table='wsm_process';
-    protected $pk='id';
-    protected $autoWriteTimestamp=false;
+    protected $table = 'wsm_process';
+    protected $pk = 'id';
+    protected $autoWriteTimestamp = false;
 
-    public static $is_del_normal=0;//是否删除,正常
-    public static $is_deleted=1;//是否删除,已删除
+    public static $is_del_normal = 0;//是否删除,正常
+    public static $is_deleted = 1;//是否删除,已删除
 
-    public static $status_normal=1;//状态,正常
-    public static $status_disable=2;//状态,禁用
+    public static $status_normal = 1;//状态,正常
+    public static $status_disable = 0;//状态,禁用
+
+    //数据类型转换
+    public function getStatusAttr($val)
+    {
+        return (string)$val;
+    }
 
 
 }