当前位置: 首页>>代码示例>>PHP>>正文


PHP Model::one方法代码示例

本文整理汇总了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);
 }
开发者ID:hachi-zzq,项目名称:guest-cms,代码行数:8,代码来源:LevelModel.class.php

示例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);
 }
开发者ID:denson7,项目名称:phpstudy,代码行数:5,代码来源:CommentModel.class.php

示例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());
 }
开发者ID:evilnapsis,项目名称:xoolar-lite,代码行数:6,代码来源:BlockData.php

示例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());
 }
开发者ID:mriveros,项目名称:library-php,代码行数:6,代码来源:ClientData.php

示例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());
 }
开发者ID:rogelino,项目名称:smile,代码行数:6,代码来源:FriendData.php

示例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());
 }
开发者ID:evilnapsis,项目名称:smile,代码行数:6,代码来源:PostData.php

示例7: Get_One_User

 public function Get_One_User()
 {
     $sql = "select * from user where id='{$this->id}' limit 1 ;";
     return parent::one($sql);
 }
开发者ID:hachi-zzq,项目名称:guest-cms,代码行数:5,代码来源:UserModel.class.php

示例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);
 }
开发者ID:Cyc429170296,项目名称:webName,代码行数:5,代码来源:ManageModel.class.php

示例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);
 }
开发者ID:hachi-zzq,项目名称:guest-cms,代码行数:5,代码来源:CommentModel.class.php

示例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);
 }
开发者ID:denson7,项目名称:phpstudy,代码行数:5,代码来源:TagModel.class.php

示例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);
 }
开发者ID:e0zhao02,项目名称:sample_code,代码行数:5,代码来源:ContentModel.class.php

示例12: getAll

 public static function getAll()
 {
     $sql = "select * from " . self::$tablename;
     $query = Executor::doit($sql);
     return Model::one($query[0], new NotificationTypeData());
 }
开发者ID:evilnapsis,项目名称:imayik,代码行数:6,代码来源:NotificationTypeData.php

示例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);
 }
开发者ID:Cyc429170296,项目名称:webName,代码行数:5,代码来源:ContentModel.class.php

示例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());
 }
开发者ID:evilnapsis,项目名称:xoolar-lite,代码行数:6,代码来源:CalificationData.php

示例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());
 }
开发者ID:evilnapsis,项目名称:smile,代码行数:6,代码来源:TeamData.php


注:本文中的Model::one方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。