示例#1
0
 public static function put($key, $value)
 {
     $set = SettingsModel::where('key', $key)->first();
     if ($set) {
         SettingsModel::where('key', $key)->update(array('value' => $value));
     } else {
         SettingsModel::insert(array('value' => $value, 'key' => $key));
     }
 }