使用PHP运算符

在操作中,一般的逻辑代码片段可以直接使用 PHP 中的运算符,如:

public function index(){
    if(intval($_GET['id']) > 0){
        echo 'id 参数有效';
    }
}

使用ThinkPHP运算符

在执行数据库操作时,在构造数组查询条件的时候需要使用 ThinkPHP 运算符:

public function index(){
 ...