SystemSetting.php 501 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: weifeng
  5. * Date: 2019-07-26
  6. * Time: 11:49
  7. */
  8. namespace app\platform\Repository;
  9. class SystemSetting
  10. {
  11. private $systemModel;
  12. public function __construct()
  13. {
  14. $this->systemModel = \app\platform\modules\system\models\SystemSetting::get();
  15. }
  16. public function getSetting()
  17. {
  18. return $this->systemModel;
  19. }
  20. public function get($key)
  21. {
  22. return $this->getSetting()->where('key', $key)->first();
  23. }
  24. }