25개 이상의 토픽을 선택하실 수 없습니다.
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?php
- /**
- *
- * ============================================================================
- * * 版权所有 蜘蛛出行 * *
- * 网站地址: http://www.zhizhuchuxing.com
- * ----------------------------------------------------------------------------
- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
- * 使用;不允许对程序代码以任何形式任何目的的再发布。
- * ============================================================================
- * Author By: 倪宗锋
- * PhpStorm RedPackController.php
- * Create By 2016/12/5 11:56 $
- */
-
-
- namespace Activity\Controller;
-
-
- use Activity\Service\RedPackService;
- use Util\Controller\MvcController;
-
- class RedPackController extends MvcController
- {
- private $service = null;
-
- public function getService($act_id = 1)
- {
- if ($this->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);
- }
- }
|