예제 #1
0
 public function postStore()
 {
     $system = Request::get('system');
     if (!empty($system)) {
         foreach ($system as $K => $v) {
             System::where('system_name', '=', $K)->update(['system_value' => $v]);
         }
         Notification::success('保存成功');
         return redirect()->back();
     }
     Notification::success('保存失败');
     return redirect()->back();
 }
예제 #2
0
 public static function saveValue($date = [])
 {
     if (is_array($date)) {
         foreach ($date as $key => $value) {
             $key = strip_tags($key);
             $option = System::where('key', $key)->first();
             if (!$option) {
                 $option = new System();
             }
             $option->key = $key;
             $option->value = strip_tags($value);
             $option->save();
         }
     }
 }