Skip to content

setSuffix 方法又有问题吗 #825

@liuheo

Description

@liuheo
// 模型定义
use think\Model;

class TestData extends Model
{
    protected function init(): void
    {
        $this->setOption('connection', 'data');
        $this->setOption('table', 'TestData_');
    }
}
// 模型使用
public function test()
{
    $testData = new TestData();
    $testData = $testData->setSuffix('1');
    // $testData->getTable(); 输出的是 TestData_ 而不是 TestData_1

}

数据库用的 MongoDB
think-orm 版本 v4.0.50

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions