westdc-zf1/application/module/Open/App.php

45 lines
839 B
PHP
Raw Normal View History

<?php
namespace Open;
use Open\Open as open;
class app extends open implements openbase
{
public $tbl_oauth_clients = "oauth_clients"; //oauth 客户端表
public function __construct($db = NULL,$auth = NULL)
{
$this->load();
}
//获得用户创建的app
public function getUserApp($uid = 0)
{
if(empty($uid))
{
$uid = $this->user->id;
}
$sql = "SELECT * FROM ".$this->tbl_oauth_clients." WHERE user_id=".$this->user->id;
$rs = $this->db->query($sql);
$rows = $rs->fetchAll();
return $rows;
}
//获得某个App的信息
public function getAppInfo($id)
{
if(empty($id))
{
return false;
}
$sql = "SELECT * FROM ".$this->tbl_oauth_clients." WHERE id=".$id;
$rs = $this->db->query($sql);
$rows = $rs->fetch();
return $rows;
}
}