thinkphp知识点

model层编写curd(模型命名格式 类名(userModel)+class.php )

//添加方法
public function insertOne($data)
{
	return $this->Table('blog_tag')->add($data);
}

//查询多条方法
public function selectOne()
{
	return $this->Table('blog_tag')->select();
}

//删除
public function deleteOne($id)
{
  	return $this->Table('blog_tag')->where("tag_id=$id")->delete();
}


 //查询单条
  public function updateOne($id)
  {
  	return $this->Table('blog_tag')->where("tag_id=$id")->find();
  }


//修改方法
  public function updateTwo($data)
  {
  	return $this->Table('blog_tag')->save($data);
  }

  

posted @ 2017-09-04 10:44  calmly  阅读(193)  评论(0编辑  收藏  举报