We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, i found a bug. Example:
class Bet extends \yii\redis\ActiveRecord { public static function primaryKey() { return [ 'game_id', //int 'stage_id', //string 'user_id' //int ]; } // some code } $bet1 = new Bet(); $bet1->game_id = 1; $bet1->user_id = 1; $bet1->stage_id = 'flop'; $bet1->sum = 0; $bet1->save(); $bet2 = Bet::find()->where([ 'game_id' => 1, 'user_id' => 1, 'stage_id' => 'flop', ])->one(); $bet2->sum = $bet2->sum + 10; $bet2->save(); // not saved, but return true
The text was updated successfully, but these errors were encountered:
fix issues yiisoft#18
4fbe167
test for bug in issue yiisoft#18
0f37ceb
solution is
public static function buildKey($key) { if (is_numeric($key)) { return $key; } elseif (is_string($key)) { return ctype_alnum($key) && StringHelper::byteLength($key) <= 32 ? $key : md5($key); } elseif (is_array($key)) { if (count($key) == 1) { return self::buildKey(reset($key)); } ksort($key); // ensure order is always the same $isNumeric = true; foreach ($key as $k => $value) { if (!is_numeric($value)) { $isNumeric = false; } $key[$k] = strval($value); // <-THIS } if ($isNumeric) { return implode('-', $key); } } return md5(json_encode($key)); }
Sorry, something went wrong.
cebe
Successfully merging a pull request may close this issue.
Hi, i found a bug. Example:
The text was updated successfully, but these errors were encountered: