get_org('refill_merchant_profit_ratio'); $counts = json_decode($content,true); $gross = $counts['gross']; $detail = $counts['detail']; return [$gross,$detail]; } public function testRatioCtl() { [$gross,$detail] = $this->getRatios(); $ratio_ctl = new refill\mratio_controlex(); $ratio_ctl->update($gross,$detail); $mchid = 10202; $ratio_ctl->ratio_match($mchid, 14, 4, 50, [1, 2]); } public function testThirdRetryPath() { refill\RefillFactory::instance(); global $config; $this->mThirdJumps = $config['third_jumps'] ?? []; $next_pcoder = function ($mchid,$pcode) { if(array_key_exists($mchid,$this->mThirdJumps)) { $jumps = $this->mThirdJumps[$mchid]; if(array_key_exists($pcode,$jumps)) { $next_pcode = $jumps[$pcode]; return [true,$next_pcode]; } } return [false,'']; }; [$can_try,$next_pcode] = $next_pcoder(10120,'x1'); [$can_try,$next_pcode] = $next_pcoder(10120,'x2'); [$can_try,$next_pcode] = $next_pcoder(10120,'x3'); } }