@@ 427-448 (lines=22) @@ | ||
424 | * |
|
425 | * @return array |
|
426 | */ |
|
427 | public function consume($code, $card_id = '') |
|
428 | { |
|
429 | if (empty($code)) { |
|
430 | $this->setError('参数错误'); |
|
431 | ||
432 | return false; |
|
433 | } |
|
434 | ||
435 | $queryStr = []; |
|
436 | ||
437 | if (!empty($card_id)) { |
|
438 | $queryStr['card_id'] = $card_id; |
|
439 | } |
|
440 | ||
441 | $queryStr['code'] = $code; |
|
442 | ||
443 | $this->apitype = 'card'; |
|
444 | $this->module = 'code'; |
|
445 | $res = $this->_post('consume', $queryStr); |
|
446 | ||
447 | return $res; |
|
448 | } |
|
449 | ||
450 | /** |
|
451 | * Code解码接口 |
|
@@ 483-503 (lines=21) @@ | ||
480 | * |
|
481 | * @return array |
|
482 | */ |
|
483 | public function getcardlist($openid, $card_id = '') |
|
484 | { |
|
485 | if (empty($openid)) { |
|
486 | $this->setError('缺少openid'); |
|
487 | ||
488 | return false; |
|
489 | } |
|
490 | ||
491 | $queryStr = []; |
|
492 | $queryStr['openid'] = $openid; |
|
493 | ||
494 | if (!empty($card_id)) { |
|
495 | $queryStr['card_id'] = $card_id; |
|
496 | } |
|
497 | ||
498 | $this->apitype = 'card'; |
|
499 | $this->module = 'user'; |
|
500 | $res = $this->_post('getcardlist', $queryStr); |
|
501 | ||
502 | return $res; |
|
503 | } |
|
504 | ||
505 | /** |
|
506 | * 获取卡券内容 |
|
@@ 717-737 (lines=21) @@ | ||
714 | * |
|
715 | * @return |
|
716 | */ |
|
717 | public function unavailable($code, $card_id) |
|
718 | { |
|
719 | if (empty($code)) { |
|
720 | $this->setError('缺少错误'); |
|
721 | ||
722 | return false; |
|
723 | } |
|
724 | ||
725 | $queryStr = []; |
|
726 | $queryStr['code'] = $code; |
|
727 | ||
728 | if (!empty($card_id)) { |
|
729 | $queryStr['card_id'] = $card_id; |
|
730 | } |
|
731 | ||
732 | $this->apitype = 'card'; |
|
733 | $this->module = 'code'; |
|
734 | $res = $this->_post('unavailable', $queryStr); |
|
735 | ||
736 | return $res; |
|
737 | } |
|
738 | ||
739 | /** |
|
740 | * 拉取卡券概况数据接口 |
|
@@ 932-949 (lines=18) @@ | ||
929 | * |
|
930 | * @return array |
|
931 | */ |
|
932 | public function membercardUserinfo($card_id, $code) |
|
933 | { |
|
934 | if (empty($card_id) || empty($code)) { |
|
935 | $this->setError('缺少参数'); |
|
936 | ||
937 | return false; |
|
938 | } |
|
939 | ||
940 | $queryStr = []; |
|
941 | $queryStr['card_id'] = $card_id; |
|
942 | $queryStr['code'] = $code; |
|
943 | ||
944 | $this->apitype = 'card'; |
|
945 | $this->module = 'membercard'; |
|
946 | $res = $this->_post('userinfo/get', $queryStr); |
|
947 | ||
948 | return $res; |
|
949 | } |
|
950 | ||
951 | /** |
|
952 | * 更新会员信息 |