改进主从读取

This commit is contained in:
thinkphp
2018-04-25 15:01:48 +08:00
parent 0ad7586556
commit 4003537d84
3 changed files with 19 additions and 9 deletions

View File

@@ -183,7 +183,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
* @param bool $master 是否从主库读取
* @return void
*/
public function readMaster($master)
public function readMaster($master = true)
{
if ($master) {
static::$readMaster[$this->class] = true;