ThinkPHP语法总结

1, $data存放实体: 

$data['title'] = I('post.title'); // 标题

$data['content'] = I('post.content'); // 正文
$data['postdate'] = I('post.postdate'); // 当前日期时间

2, $result = $article->data($data)->save();  返回 0或者1 

o===false

1===true

3,HTML中 路径

href= "{:U('edit')}?tid={:I('get.tid')}"

4  UNION 使用

$res=$model->field('id,uid,realname,DEPTID as depid')
->where($data)->table('gusers')
->union('SELECT id,uid,realname,deptid FROM lusers where deptid ='.$parentid)
->select();

原文地址:https://www.cnblogs.com/sunzhenyong/p/4234290.html