|
@@ -29,17 +29,16 @@ class TestBigData extends TestCase
|
|
|
refill\RefillFactory::instance()->UpdateRatio($ratios);
|
|
|
}
|
|
|
|
|
|
- public function testSort()
|
|
|
+ public function testCache()
|
|
|
{
|
|
|
- $out_price =
|
|
|
- $desc_profit = function ($l, $r) use($out_price) {
|
|
|
- [$lSucc,$lRatio] = $l->notify_ratio();
|
|
|
- [$rSucc,$rRatio] = $r->notify_ratio();
|
|
|
-
|
|
|
- $lprofit = ($out_price - $l->price()) * $lRatio;
|
|
|
- $rprofit = ($out_price - $r->price()) * $rRatio;
|
|
|
- return $lprofit < $rprofit ? 1 : -1;
|
|
|
- };
|
|
|
- usort($ratio_ctls, $desc_profit);
|
|
|
+ $ins = Cache::getInstance('cacheredis');
|
|
|
+ $val = $ins->get_org('channel_ratios');
|
|
|
+ Log::record("subscribe_message channel_ratios val={$val}",Log::DEBUG);
|
|
|
+ if(empty($val));
|
|
|
+ $val = json_decode($val,true);
|
|
|
+ if(empty($val));
|
|
|
+ $ratios = $val['ratios'];
|
|
|
+ if(empty($ratios));
|
|
|
+
|
|
|
}
|
|
|
}
|