下面第三行调用代码没看懂,求教?

解决方案 »

  1.   


    <?php
    namespace app\index\model;use think\Model;class User extends Model
    {    public function scopeThinkphp($query)
        {
            $query->where('name','thinkphp')->field('id,name');
        }
        
        public function scopeAge($query)
        {
            $query->where('age','>',20)->limit(10);
        }    
        
    }// 查找name为thinkphp的用户
    User::scope('thinkphp')->find();
    // 查找年龄大于20的10个用户
    User::scope('age')->select();
    // 查找name为thinkphp的用户并且年龄大于20的10个用户
    User::scope('thinkphp,age')->select();
      

  2.   

    那上面书上写的第三个调用应该是('adult,male')吧。