Authored by 郭成尧

'领券操作返回信息'

... ... @@ -77,17 +77,27 @@ class CouponController extends AbstractAction
$receiveData = filter_input_array(INPUT_GET, array(
'couponIds' => FILTER_DEFAULT
));
$returnData = '';
$returnData = array();
$couponIds = explode(',', str_replace(' ', '', $receiveData['couponIds']));
switch ($this->getCoupon($couponIds)){
$returnStatus = $this->getCoupon($couponIds);
switch ($returnStatus){
case 1:
$returnData = '领券成功!';
$returnData = [
'msg' => '领券成功!',
'status' => $returnStatus
];
break;
case 2:
$returnData = '领券失败!';
$returnData = [
'msg' => '领券失败!',
'status' => $returnStatus
];
break;
case 3:
$returnData = '券已经被领光了!';
$returnData = [
'msg' => '券已经被领光了!',
'status' => $returnStatus
];
break;
default:
$returnData = '未知错误!';
... ...