|
|
<?php
|
|
|
|
|
|
use Action\AbstractAction;
|
|
|
use Coupon\CouponModel;
|
|
|
|
|
|
/**
|
|
|
* 领券相关的控制器
|
|
|
*
|
|
|
* @name CouponController
|
|
|
* @package
|
|
|
* @copyright yoho.inc
|
|
|
* @version 1.0 (2016-04-19 16:30:44)
|
|
|
* @author Gtskk (2330416537@qq.com)
|
|
|
*/
|
|
|
class CouponController extends AbstractAction
|
|
|
{
|
|
|
|
|
|
/**
|
|
|
* 获取优惠券
|
|
|
*/
|
|
|
public function couponSendAction()
|
|
|
{
|
|
|
$callback = $this->get('callback');
|
|
|
$token = $this->get('token', '');
|
|
|
$uid = $this->getUid(true);
|
|
|
$appVersion = $this->get('app_version', '');
|
|
|
|
|
|
// APP时用参数中的ID
|
|
|
if (!empty($appVersion)) {
|
|
|
$uid = $this->get('uid', 0);
|
|
|
}
|
|
|
|
|
|
$result = CouponModel::couponSend($uid, $token);
|
|
|
|
|
|
$this->helpJsonCallbackResult($callback, $result['code'], $result['message'], $result['data']);
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|