可以对模型的查询和写入操作进行封装,例如: namespace app \ index \ model ; use think \ Model ; class User extends Model { protected function scopeThinkphp ($query) { $query-where( name , thinkphp )-field( id,name ); } p
支持给字段设置类型自动转换,会在写入和读取的时候自动进行类型转换处理,例如: class User extends Model { protected $ type = [ statu s = intege r, scor e = floa t, birthda y = datetim e, inf o = arra y, ]