/** * 查询默认不包含软删除数据 * @access protected * @param \think\db\Query $query 查询对象 * @return void */ protected function base($query) { $field = $this->getDeleteTimeField(true); $query->where($field, 'null'); }
/** * 查询默认不包含软删除数据 * @access protected * @param \think\db\Query $query 查询对象 * @return void */ protected static function base($query) { if (static::$deleteTime) { $query->where(static::$deleteTime, 'null'); } }