1234567891011121314151617181920212223242526272829 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Elton
- * Date: 2020/4/9
- * Time: 17:50
- */
- namespace app\common\model;
- use think\Config;
- use think\Model;
- class PolarDbModel extends Model
- {
- /**
- * PolarDbModel constructor.
- * @param array $data
- * @param bool $isPolarDb 是否使用PolarDb 数据库
- */
- public function __construct($data = [], $isPolarDb = true)
- {
- if ($isPolarDb) {
- $this->connection = Config::get('polardb') ?? [];
- }
- parent::__construct($data);
- }
- }
|