本文整理汇总了PHP中Model::one方法的典型用法代码示例。如果您正苦于以下问题:PHP Model::one方法的具体用法?PHP Model::one怎么用?PHP Model::one使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model
的用法示例。
在下文中一共展示了Model::one方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Get_One_Level
public function Get_One_Level()
{
global $templates;
$this->id = $_GET['id'];
$this->level_position = $_POST['level_position'];
$sql = "select id,level_position,level_info from manage_level where id='{$this->id}' or level_position='{$this->level_position}' limit 1 ;";
return parent::one($sql);
}
示例2: getOneComment
public function getOneComment()
{
$_sql = "SELECT \n\t\t\t\t\t\t\t\t\t\t\tid \n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\t\tcms_comment\n\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\t\t\tid='{$this->id}' \n\t\t\t\t\t\t\t\tLIMIT \n\t\t\t\t\t\t\t\t\t\t\t1";
return parent::one($_sql);
}
示例3: getByATD
public static function getByATD($alumn, $team, $date_at)
{
$sql = "select * from " . self::$tablename . " where alumn_id={$alumn} and team_id={$team} and date_at=\"{$date_at}\"";
$query = Executor::doit($sql);
return Model::one($query[0], new BlockData());
}
示例4: getById
public static function getById($id)
{
$sql = "select * from " . self::$tablename . " where id={$id}";
$query = Executor::doit($sql);
return Model::one($query[0], new ClientData());
}
示例5: getFriendship
public static function getFriendship($user_id, $friend_id)
{
$sql = "select * from " . self::$tablename . " where (sender_id={$user_id} and receptor_id={$friend_id}) or (receptor_id={$user_id} and sender_id={$friend_id}) ";
$query = Executor::doit($sql);
return Model::one($query[0], new FriendData());
}
示例6: getReceptorId
public static function getReceptorId($id)
{
$sql = "select receptor_ref_id,author_ref_id from " . self::$tablename . " where id={$id}";
$query = Executor::doit($sql);
return Model::one($query[0], new PostData());
}
示例7: Get_One_User
public function Get_One_User()
{
$sql = "select * from user where id='{$this->id}' limit 1 ;";
return parent::one($sql);
}
示例8: getOneManage
public function getOneManage()
{
$_sql = "SELECT \n\t\t\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\t\t\tadmin_user,\n\t\t\t\t\t\t\t\t\t\tadmin_pass,\n\t\t\t\t\t\t\t\t\t\tlevel \n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\tcms_manage \n\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\t\tid='{$this->id}' \n\t\t\t\t\t\t\t\t\tOR\n\t\t\t\t\t\t\t\t\t\tadmin_user='{$this->admin_user}'\n\t\t\t\t\t\t\t\t\tOR\n\t\t\t\t\t\t\t\t\t\tlevel='{$this->level}'\n\t\t\t\t\t\t\t\tLIMIT \n\t\t\t\t\t\t\t\t\t\t1";
return parent::one($_sql);
}
示例9: Get_Title_Info
public function Get_Title_Info()
{
$sql = "select \r\n\t\t\t\t\t\t\t\tcon.title,\r\n\t\t\t\t\t\t\t\tcon.info\r\n\t\t\t\t\t\tfrom\r\n\t\t\t\t\t\t\t\tcontent as con\r\n\t\t\t\t\t\tleft join\r\n\t\t\t\t\t\t\t\tcomment as com\r\n\t\t\t\t\t\ton\r\n\t\t\t\t\t\t\t\tcom.cid = con.id \r\n\t\t\t\t\t\twhere\r\n\t\t\t\t\t\t\t\tcom.cid ='{$this->cid}'\r\n\t\t\t\t\t\tlimit 1";
return parent::one($sql);
}
示例10: getOneTag
public function getOneTag()
{
$_sql = "SELECT \n\t\t\t\t\t\t\t\t\t\t\tid \n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\t\tcms_tag \n\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\t\t\ttagname='{$this->tagname}'";
return parent::one($_sql);
}
示例11: getOneContent
public function getOneContent()
{
$_sql = "select id, title, nav, attr, content, info, date, count, author, source, thumbnail, tag, color, keyword, sort, readlimit, commend, gold from cms_content where id='{$this->id}';";
return parent::one($_sql);
}
示例12: getAll
public static function getAll()
{
$sql = "select * from " . self::$tablename;
$query = Executor::doit($sql);
return Model::one($query[0], new NotificationTypeData());
}
示例13: getParam
public function getParam()
{
$_sql = "SELECT \n\t\t\t\t\t\t\t\t\t\tparam1,\n\t\t\t\t\t\t\t\t\t\tparam2,\n\t\t\t\t\t\t\t\t\t\tparam3\n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\ttg_module\n\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t\tmid='{$this->mid}'\n\t\t\t\t\t\t\t\tLIMIT 1";
return parent::one($_sql);
}
示例14: getByBA
public static function getByBA($block, $alumn)
{
$sql = "select * from " . self::$tablename . " where alumn_id={$alumn} and block_id={$block}";
$query = Executor::doit($sql);
return Model::one($query[0], new CalificationData());
}
示例15: countByUserId
public static function countByUserId($id)
{
$sql = "select count(*) as c from " . self::$tablename . " where user_id={$id}";
$query = Executor::doit($sql);
return Model::one($query[0], new TeamData());
}