public function testTableNameByThis() { $post = new Post(); $table_name = $post->tableName(); $this->assertSame($table_name, 'post'); }
/** * @return \common\models\cms\PostQuery */ public function active() { $this->andWhere([Post::tableName() . '.status' => 1, Post::tableName() . '.deleted' => 0]); //双[[]]表示and return $this; }