码迷,mamicode.com
首页 > 其他好文 > 详细

11111

时间:2017-09-01 00:04:04      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:isa   art   cti   find   article   title   log   turn   condition   

public function page()
    {
    	if (Request::instance()->isAjax()){
    		$title = " 1=1 ";
			
			if(!empty($_POST["title"])){
				$name = " title like ‘%".$_POST["title"]."%‘ ";
			}
			
			$condition = " {$title} ";
			$arr = Db::name(‘article‘)->field(" count(*) as num ")->where($condition)->find();
			echo ceil($arr["num"]/6).chr(2).$arr["num"];
    	}
    }
	

 

public function click()
    {
    	if (Request::instance()->isAjax()){
			$page = $_POST["page"];
			$title = " 1=1 ";
			
			if(!empty($_POST["title"])){
				$name = " title like ‘%".$_POST["title"]."%‘ ";
			}
			
			$condition = " {$title} ";
			$arr = Db::name(‘article‘)->where($condition)->page($page,6)->select();
			Return($arr);
    	}
    }

 

11111

标签:isa   art   cti   find   article   title   log   turn   condition   

原文地址:http://www.cnblogs.com/yi11/p/7460924.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!