coresetting.table.php 825 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /**
  3. * [WeEngine System] Copyright (c) 2014 WE7.CC
  4. * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
  5. */
  6. defined('IN_IA') or exit('Access Denied');
  7. class CoresettingTable extends We7Table {
  8. protected $tableName = 'core_settings';
  9. protected $field = array('key', 'value');
  10. public function getSettingList() {
  11. return $this->query->from($this->tableName)->getall('key');
  12. }
  13. public function settingSave($key, $data) {
  14. $is_exists = $this->query->from($this->tableName)->where('key', $key)->get();
  15. if (!empty($is_exists)) {
  16. $return = table('coresetting')->fillValue(iserializer($data))->whereKey($key)->save();
  17. } else {
  18. $return = table('coresetting')->fill(array('key'=> $key, 'value' => iserializer($data)))->save();
  19. }
  20. return $return;
  21. }
  22. }