12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace app\common\models;
- class OAuth extends Model {
- protected $name = "oauth";
-
- public static function getSetting($name,$value=""){
- $row = self::where(["name"=>$name])->find();
- if(empty($row["config"])) return null;
- $array = json_decode($row["config"],true);
- if(empty($array)){
- return $array;
- }
- if(isset($array[$value])){
- return trim($array[$value]);
- }
- return null;
- }
- public function getConfigAttr($value){
- if(empty($value)) return "";
- return json_decode($value,true);
- }
- }
|