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


PHP Model::select方法代码示例

本文整理汇总了PHP中Model::select方法的典型用法代码示例。如果您正苦于以下问题:PHP Model::select方法的具体用法?PHP Model::select怎么用?PHP Model::select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Model的用法示例。


在下文中一共展示了Model::select方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getCategoryAll

 public function getCategoryAll()
 {
     $model = new Model();
     $query = 'SELECT * FROM category';
     $values = $model->select($query);
     return $values;
 }
开发者ID:anton-phpcurs,项目名称:mvc,代码行数:7,代码来源:model_category.php

示例2: active_info

 public function active_info()
 {
     $v_id = $this->get_volun_id();
     $obj = new Model('t_active');
     if (empty($v_id)) {
         $other_content = $obj->select();
         $this->assign('other_content', $other_content);
     } else {
         //列出自己发布的项目
         $where = 'v_id=\'' . $v_id . '\'';
         $my_content = $obj->where($where)->select();
         $this->assign('my_content', $my_content);
         $v_g = new Model('t_volun_group');
         $act = $v_g->where('volun_join_id=\'' . $v_id . '\'')->field('a_id')->select();
         $arr = array();
         foreach ($act as $v) {
             $arr[] = $v['a_id'];
         }
         $str2 = implode(',', $arr);
         //我参与的活动
         $where = 'a_id in (' . $str2 . ')';
         $my_join_content = $obj->where($where)->select();
         $this->assign('my_join_content', $my_join_content);
         //列出不是自己发布的项目
         $where = 'v_id<>\'' . $v_id . '\'';
         $other_content = $obj->where($where)->select();
         $this->assign('other_content', $other_content);
     }
     $this->display();
 }
开发者ID:dalinhuang,项目名称:voter,代码行数:30,代码来源:ActiveAction.class.php

示例3: add

 public function add()
 {
     $where['id'] = $_GET['id'];
     if ($where['id']) {
         $array = $this->SelfDB->where($where)->find();
         /*
         			if (C('web_admin_edittime')){
         			$array['checktime']= 'checked';
         			}
         */
         $array['tpltitle'] = '编辑';
     } else {
         $array['addtime'] = time();
         //$array['checktime']= 'checked';
         $array['tpltitle'] = '添加';
     }
     $this->assign('array', $array);
     //手工分类
     //$m	=	new module('self_type');
     $m = new Model('self_type');
     //var_dump($m);
     $select = $m->select();
     $dataArr = $this->SelfDB->order('orders desc')->select();
     //print_r($select);
     $this->assign('typeArr', $select);
     $this->assign('dataArr', $dataArr);
     $this->display('./views/admin/Self_index.html');
 }
开发者ID:skygunner,项目名称:ekucms,代码行数:28,代码来源:SelfAction.class.php

示例4: index

 public function index()
 {
     $db = new Model('user');
     $select = $db->select();
     $this->assign('select', $select);
     $this->display();
 }
开发者ID:windform,项目名称:php,代码行数:7,代码来源:IndexAction.class.php

示例5: findOne

 public function findOne()
 {
     $where = array("id='{$this->R['id']}'");
     if (!$this->check->checkOne($this, $where)) {
         $this->check->showError();
     }
     return parent::select(array('id', 'price_left', 'price_right'), array('where' => $where, 'limit' => '1'));
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:8,代码来源:PriceModel.class.php

示例6: findAllNav

 public function findAllNav()
 {
     $_allPrice = parent::select(array('id', 'price_left', 'price_right'), array('order' => 'price_left ASC,price_right ASC'));
     foreach ($_allPrice as $_value) {
         $_value->value = $_value->price_left . ' - ' . $_value->price_right;
     }
     return $_allPrice;
 }
开发者ID:yjf0503,项目名称:Mall,代码行数:8,代码来源:PriceModel.class.php

示例7: findOne

 public function findOne()
 {
     $_where = array("id='{$this->_R['id']}'");
     if (!$this->_check->oneCheck($this, $_where)) {
         $this->_check->error();
     }
     return parent::select(array('id', 'name', 'url', 'info', 'price_in', 'price_out', 'price_add'), array('where' => $_where, 'limit' => '1'));
 }
开发者ID:yjf0503,项目名称:Mall,代码行数:8,代码来源:DeliveryModel.class.php

示例8: ajaxTest

 public function ajaxTest()
 {
     $Demo = new Model('Demo');
     // 实例化模型类
     $list = $Demo->select();
     // 查询数据
     $this->ajaxReturn($list, "新增错误!", 1);
 }
开发者ID:nehnre,项目名称:nie-blog,代码行数:8,代码来源:AdminAction.class.php

示例9: constructBlogByID

 /**
  * constructs new object from database with the the id $id
  *
  * @param $id
  * @return Blog
  */
 public static function constructBlogByID($id)
 {
     $query = "SELECT * FROM Blog WHERE blog_id = " . intval($id);
     $res = parent::select($query);
     if ($res) {
         return self::constructBlog($res[0]);
     }
 }
开发者ID:M4R1KU,项目名称:WebLog,代码行数:14,代码来源:Blog.php

示例10: findOne

 public function findOne()
 {
     $where = array("id='{$this->R['id']}'");
     if (!$this->check->checkOne($this, $where)) {
         $this->check->showError();
     }
     return parent::select(array('id', 'name', 'url', 'info', 'type'), array('where' => $where, 'limit' => '1'));
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:8,代码来源:BrandModel.class.php

示例11: findOne

 public function findOne()
 {
     $_where = array("user='{$_COOKIE['user']}' AND selected = 1");
     //        if(!$this->_check->oneCheck($this,$_where))
     //        {
     //            $this->_check->error();
     //        }
     return parent::select(array('id', 'user', 'name', 'email', 'tel', 'code', 'buildings', 'address', 'flag'), array('where' => $_where, 'limit' => '1'));
 }
开发者ID:yjf0503,项目名称:Mall,代码行数:9,代码来源:AddressModel.class.php

示例12: findOne

 public function findOne()
 {
     $_where = array("goods_id='{$this->_R['goods_id']}' AND order_id='{$this->_R['order_id']}'");
     //		if(!$this->_check->oneCheck($this,$_where))
     //		{
     //			$this->_check->error();
     //		}
     return parent::select(array('star', 'content', 're_content'), array('where' => $_where, 'limit' => '1'));
 }
开发者ID:yjf0503,项目名称:Mall,代码行数:9,代码来源:CommendModel.class.php

示例13: index

 public function index()
 {
     $m = new Model('User');
     $arr = $m->select();
     //print_r($arr);
     $this->assign('data', $arr);
     //这样可以在view页面动态的输出$data
     $this->display();
 }
开发者ID:ryuqing,项目名称:myblog,代码行数:9,代码来源:IndexAction.class.php

示例14: findOne

 public function findOne()
 {
     $where = array("user='{$_COOKIE['user']}'", "selected=1");
     if (isset($this->R['id'])) {
         $where = array("id='{$this->R['id']}'");
     }
     //if(!$this->check->checkOne($this,$where))$this->check->showError();
     return parent::select(array('id', 'name', 'email', 'address', 'flag', 'tel', 'time', 'code', 'buildings'), array('where' => $where, 'limit' => '1'));
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:9,代码来源:AddressModel.class.php

示例15: delete

 public function delete()
 {
     $_where = array("id='{$this->_R['id']}'");
     $_service = parent::select(array('first'), array('where' => $_where, 'limit' => '1'));
     if ($_service[0]->first == 1) {
         return 0;
     } else {
         return parent::delete($_where);
     }
 }
开发者ID:yjf0503,项目名称:Mall,代码行数:10,代码来源:ServiceModel.class.php


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