canyin-project/ybcy/models/common/Power.php

36 lines
1013 B
PHP
Raw Normal View History

2024-11-01 16:07:54 +08:00
<?php
namespace app\models\common;
use yii\db\ActiveRecord;
use app\models\common\Config;
class Power extends ActiveRecord{
//查看权限
public static function getPower($uniacid,$name=null){
$power=Config::getSystemSet('sysTopImage',$uniacid);
if($name){
$power=$power[$name];
}
if(!$power){
$power=Config::getSystemSet('superPower',0);
}else{
return Config::getSystemSet('sysTopImage',$uniacid);
}
return $power;
}
//查看付费权限
public static function getPayPower($uniacid,$name){
$power=Config::getSystemSet('sysTopImage',$uniacid);
if(!$power){
$power=Config::getSystemSet('superPower',0);
}
$plug=getSysInfo();
$plug_list=$plug['authData']['plug'];
$plug_ids=array_values(array_intersect($power['plug_str'],$plug_list));
if(in_array($name,$plug_ids)){
return true;
}
return false;
}
}