class CliInfo extends ActiveRecord
{
public static function collectionName()
{
return 'cli_info';
}
public function attributes()
{
return [ $attributes]; // 这里是一定要被复写的 而且必须包含 _id
}
}
一般的功能是不是需要在model里面封装的
update CliInfo::find()->where($where)->modify($update)
query CliInfo::find()
->select($fileds)
->one();之前犯了一个低级的错误 (new CliInfo())::find() 这种调用的方式是不行的 因为 new CliInfo()是对象,对象调用精华太方法必须 -> 自然不可以使用静态调用的方式