1, mtopcard\ChinaUnicomCard => 2, mtopcard\ChinaTelecomCard => 3 ]; const Product = [ mtopcard\ChinaMobileCard => [ 10 => 20001, 20 => 20002, 30 => 20003, 50 => 20004, 100 => 20005, 200 => 20006, 300 => 20007, 500 => 20008 ], mtopcard\ChinaUnicomCard => [ 10 => 20009, 20 => 20010, 30 => 20011, 50 => 20012, 100 => 20013, 200 => 20014, 300 => 20015, 500 => 20016 ], mtopcard\ChinaTelecomCard => [ 10 => 20017, 20 => 20018, 30 => 20019, 50 => 20020, 100 => 20021, 200 => 20022, 300 => 20023, 500 => 20024 ], ]; const ERR_STATUS = ['-10001', '-10002', '-10003', '-10004', '-10013', '-10005', '-10006', '-10007', '-10008', '-10009', '-10011', '-10012', '-10015', '-10016']; const NET_ERR_STATUS = ['-10010', '-10000', '-999']; public static function sign($params) { ksort($params); $content = ''; foreach ($params as $key => $value) { if(self::check_empty($value) === false) { $content .= "{$key}{$value}"; } } $content .= config::CP_KEY; return md5($content); } public static function check_empty($value) { if (!isset($value)) return true; if ($value === null) return true; if (trim($value) === "") return true; return false; } }