0) { header("HTTP/1.1 422 Unprocessable Entity"); echo json_encode($fail_arr); exit(); } // 合約類型 $clientType = [ '1' => 'new', '2' => 'free_to_charge', '3' => 'renew_priceissue' ]; // 應付日期 $day = DateTime::createFromFormat('Ymd', $payDay); $pay_day = $day->format('Y-m-d'); $years = $maintain_month / 12; $contract_years = ($years >= 2) ? 'above_two' : 'one'; $result = maintenance_contract_bonus_v2_0( $bonuns_verson, $clientType[$client_type], $contract_years, 0.8, $maintain_price_total, 0, $payDay, $receiver, $manager, $a ); header('Content-Type: application/json'); echo json_encode($result); }