find(); if ($state) { if (!$query) { $result = self::create(['key_data' => $server_string, 'value_data' => json_encode(['quota' => $quota, 'maxQuota' => $maxQuota, 'state' => 1])]); }else { $result = self::whereIn('key_data',$server_string)->update([ 'value_data' => json_encode(['quota' => $quota, 'maxQuota' => $maxQuota, 'state' => 1]) ]); } } else { if (!$query) { exception(lang('no_open_gold', [$server_id])); } $result = self::whereIn('key_data',$server_string)->update(['value_data' => json_encode(['state' => 0])]); } return $result ? ['code'=>0, 'msg' => lang('success')] : exception(lang('error')); } }