1.数据库操作
1.1 in , not in
$res = Db::table('course')->where('Cno','not in','3,4,5,6')->select()->toArray();
print_r($res);
1.2 like, not like
% 和 _
$res = Db::table('course')->where('Cname','like','数%')->select()->toArray();
print_r($res);
1.3 and or
$res = Db::table('course')->where('Cname','数学')->where('Cpno',7)->select()->toArray();
// print_r($res);
// $res = Db::table('course')->where('Cname','数学')->whereOr('Cname','操作系统')->select()->toArray();
// print_r($res);
1.4其他
//聚合操作
// $res = Db::table('course')->sum('Cno');
// echo $res;
//排序 ASC,DESC
$res = Db::table('course')->order('Cno','DESC')->field('Cno')->select()->toArray();
print_r($res);
//group 和 having
//page 和 limit
2.TP请求
/**
* d:整数
* s:字符串
* a:数组
* f:浮点数
* b:布尔值
*
* $_GET $_POST和 Request::get() Request::post()一样
*/
print_r(Request::get('id/b'));