wugg 9 місяців тому
батько
коміт
38b14b4f9d
2 змінених файлів з 21 додано та 2 видалено
  1. 7 2
      app/bug/controller/Subscribe.php
  2. 14 0
      app/bug/model/WorkSubscr.php

+ 7 - 2
app/bug/controller/Subscribe.php

@@ -4,7 +4,12 @@
 namespace app\bug\controller;
 
 
-use app\bug\model\WorkAction;use app\bug\model\WorkSubinfo;use app\bug\model\WorkSubscr;use think\App;use think\Exception;use think\facade\Validate;
+use app\bug\model\WorkAction;
+use app\bug\model\WorkSubinfo;
+use app\bug\model\WorkSubscr;
+use think\App;
+use think\Exception;
+use think\facade\Validate;
 class Subscribe extends Base{
 	public function __construct(App $app) {
 		parent::__construct($app);
@@ -24,7 +29,7 @@ class Subscribe extends Base{
 		$data = [
 			'belong'=>$param['belong'],
 			'action'=>$param['action'],
-			'role_action'=>WorkAction::where("id","=",$this->roleid)->value("action",""),
+			'role_action'=>WorkRole::where("id","=",$this->roleid)->value("action",""),
 			'role_id'=>$this->roleid,
 			'apply_id'=>$this->uid,
 			'apply_name'=>$this->uname,

+ 14 - 0
app/bug/model/WorkSubscr.php

@@ -29,4 +29,18 @@ use think\model\concern\SoftDelete;class WorkSubscr extends Base
     public function subInfo(){
     	return $this->hasMany(WorkSubinfo::class,'sub_id','id');
     }
+    
+   public function GetActionAttr($v){
+    	return json_decode($v,true);
+    }
+    public function SetActionAttr($v){
+        	return json_encode($v,JSON_UNESCAPED_UNICODE);
+    }
+    
+    public function GetRoleActionAttr($v){
+        	return json_decode($v,true);
+        }
+    public function SetRoleActionAttr($v){
+            	return json_encode($v,JSON_UNESCAPED_UNICODE);
+     }
 }