AdminMoney.php 608 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. use think\Config;
  5. class AdminMoney extends Model
  6. {
  7. // 表名
  8. protected $table = 'admin_money';
  9. // 开启自动写入时间戳字段
  10. protected $autoWriteTimestamp = 'int';
  11. // 定义时间戳字段名
  12. protected $createTime = 'createtime';
  13. protected $updateTime = 'updatetime';
  14. /**
  15. * 连接主库
  16. * @return $this
  17. */
  18. public function setConnect()
  19. {
  20. $config = Config::get('database');
  21. $config['admin_rw_separate'] = false;
  22. $this->connect($config);
  23. return $this;
  24. }
  25. }