[ 'is_enable' => 1, 'is_user_receive' => 1, ], 'm' => 0, 'n' => 1000000, 'is_sure_receive' => 1, 'user' => $this->user, ]; $ret = CallPluginsServiceMethod('coupon', 'CouponService', 'CouponList', $coupon_params); // 返回数据 $result = [ 'base' => $base['data'], 'data' => $ret['data'], ]; return DataReturn('处理成功', 0, $result); } /** * 用户优惠劵列表 * @author Devil * @blog http://gong.gg/ * @version 1.0.0 * @date 2019-10-15 * @desc description */ public function User() { // 是否登录 $this->IsLogin(); // 获取用户优惠劵 $coupon_params = [ 'user' => $this->user, 'where' => [ 'user_id' => $this->user['id'], 'is_valid' => 1, ], ]; return CallPluginsServiceMethod('coupon', 'UserCouponService', 'CouponUserList', $coupon_params); } /** * 领取优惠劵 * @author Devil * @blog http://gong.gg/ * @version 1.0.0 * @date 2019-10-15 * @desc description */ public function Receive() { // 是否登录 $this->IsLogin(); // 是否ajax请求 if(!IS_AJAX) { return $this->error('非法访问'); } // 领取优惠劵 return CallPluginsServiceMethod('coupon', 'CouponService', 'UserReceiveCoupon', $this->data_post); } } ?>