示例#1
0
文件: core.php 项目: khoapld/wjshop
 public function check_maintenance()
 {
     $config = Model_Config::find('first');
     View::set_global('config', $config);
     if ($this->action === 'maintenance' && (int) $config->maintenance !== 1) {
         Response::redirect('/');
     }
     if (!in_array($this->action, ['maintenance']) && (int) $config->maintenance === 1) {
         Response::redirect('/maintenance');
     }
 }
示例#2
0
文件: config.php 项目: khoapld/wjshop
 public static function update($data)
 {
     try {
         $data['updated_at'] = date('Y-m-d H:i:s', Date::forge()->get_timestamp());
         $query = Model_Config::find(1);
         $query->set($data);
         $query->save();
     } catch (Exception $e) {
         Log::write('ERROR', $e->getMessage());
         return false;
     }
     return true;
 }
示例#3
0
 public function action_index()
 {
     $this->data['config'] = Model_Config::find('first');
     $this->template->content = View::forge($this->layout . '/dashboard/index', $this->data);
 }