- 博客(7)
- 资源 (1)
- 收藏
- 关注
原创 联合查询 thinkPHP
public function trace() { $page = I('get.p'); $page = $page ? $page : 1; $start = ($page - 1) * 10; $where['a.uid'] = session('ip'); if (I('get.')) { $data = I('get.'); $this->assign('get', $da
2016-05-10 16:58:28 1217
原创 thinkphp 返回ajax 及switch
/** * Ajax方式返回数据到客户端 * @access protected * @param mixed $data 要返回的数据 * @param String $type AJAX返回数据格式 * @param int $json_option 传递给json_encode的option参数 * @return vo
2016-05-10 16:05:11 456
原创 swith case
if($method->getNumberOfParameters()>0 && C('URL_PARAMS_BIND')){ switch($_SERVER['REQUEST_METHOD']) { case 'POST': $vars = array_merge($_GET,$_POST); break; case 'PUT': parse_str(file_get_con
2016-05-10 16:01:07 355
转载 thinkPHP
public function getGroups($uid) { static $groups = array(); if (isset($groups[$uid])) return $groups[$uid]; $user_groups = M() ->table($this->_conf
2016-05-10 15:56:18 279
原创 thinkphp 联合查询
联合查询 1、原生查询 $sql =$sql='select p.product_name,z.message as zmessage,z.rdtime,r.message,r.rdtime from wsd_product as p,wsd_product_zixun as z,wsd_product_zixun_reply as r where p.id=z
2016-05-10 15:52:53 335
原创 PHP 初始化文件 自动加载 面向过程
define('ROOT' , realpath(__DIR__ . '/..')); function autuload($class) { if( substr($class , -5) === 'Model' && (strlen($class) > 5) ) { require(ROOT . '/Model/' . $class . '.php'); } else { r
2016-05-10 13:35:38 484
原创 php 父类Model实现
class Model { protected $db = null; protected $table = ''; protected $pk = ''; protected $fields = array(); protected $data = array(); protected $options = array('fields'=>'*' , 'where'=>'','gro
2016-05-10 13:29:41 573
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人