'bigint',// 'role_id' =>'bigint',// 'action_data' =>'text',// 'action_conllect' =>'text',// 'private_data' =>'text',// 'status' =>'int',// 'addtime' =>'datetime',// 'updatetime' =>'datetime',// ]; protected $updateTime='updatetime'; protected $createTime='addtime'; public function GetActionConllectAttr($v){ return json_decode($v,true); } public function SetActionConllectAttr($v){ return json_encode($v,JSON_UNESCAPED_UNICODE); } public function GetActionDataAttr($v){ return json_decode($v,true); } public function SetActionDataAttr($v){ return json_encode($v,JSON_UNESCAPED_UNICODE); } public function GetPrivateDataAttr($v){ return json_decode($v,true); } public function SetPrivateDataAttr($v){ return json_encode($v,JSON_UNESCAPED_UNICODE); } public static function checkRole($roleid,$actionid){ $info = self::where([['role_id',"in",$roleid],["status","=",1]])->findOrEmpty(); if ($info->isEmpty()) return false; $provate_data = $info->private_data; if(is_array($actionid))return empty(array_intersect($actionid,$provate_data))==false; if(is_string($actionid)||is_int($actionid)) return in_array($actionid,$provate_data); } }