service == null) { $this->service = new RedPackService($act_id); } return $this->service; } /** * Function Description:发送红包 * Function Name: sendRedPackAction * * @return string * * @author 倪宗锋 */ public function sendRedPackAction() { $params = $_GET; $act_id = empty($params['act_id']) ? 1 : $params['act_id']; //参数校验 $checkSign = $this->getService($act_id)->checkParams($params); if ($checkSign['flag'] == false) { return json_encode($checkSign); } $openid = $params['openid']; $sendRedPack = $this->getService($act_id)->sendRedPack($openid);//发送红包 return json_encode($sendRedPack); } }