mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-09-02 05:31:36 +08:00
设置了主从服务器后,支持从主服务器读数据
方法是在模型类中调用 readMaster方法 $this->readMaster()->select(); 该方法当此调用有效
This commit is contained in:
@@ -1317,4 +1317,14 @@ class Model {
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置从主服务器读取数据
|
||||
* @access public
|
||||
* @return Model
|
||||
*/
|
||||
public function readMaster(){
|
||||
$this->options['read_master'] = true;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user