sign($input); if ($params['appid'] == config::APPID && $params['signature'] == $sign) { return true; } else { return false; } } protected function check_empty($value) { if (!isset($value)) return true; if ($value === null) return true; if (trim($value) === "") return true; return false; } private function sign($input) { $key = config::APPKEY; $input['token'] = $key; $body = config::body($input); return strtolower(md5($body)); } //[$order_id, $success, $can_try, $need_handle] public function notify($params) { $status = intval($params['status']); $order_sn = $params['morder']; $order_info = Model('vr_order')->getOrderInfoForNotify(['order_sn' => $order_sn]); if (empty($order_info)) { return [false, false, false,false]; } $order_id = $order_info['order_id']; if ($status === 2) { $data['official_sn'] = strtolower($params['vnum']) == 'null' ? '' : $params['vnum']; Model('refill_order')->edit($order_id, $data); return [$order_id, true, false,true]; } elseif ($status === 3) { return [$order_id, false, true,true]; } else { return [$order_id, false, false,false]; } } }