| @@ 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 | * 拉取卡券概况数据接口 |
|
| @@ 919-936 (lines=18) @@ | ||
| 916 | * |
|
| 917 | * @return array |
|
| 918 | */ |
|
| 919 | public function membercardUserinfo($card_id, $code) |
|
| 920 | { |
|
| 921 | if (empty($card_id) || empty($code)) { |
|
| 922 | $this->setError('缺少参数'); |
|
| 923 | ||
| 924 | return false; |
|
| 925 | } |
|
| 926 | ||
| 927 | $queryStr = []; |
|
| 928 | $queryStr['card_id'] = $card_id; |
|
| 929 | $queryStr['code'] = $code; |
|
| 930 | ||
| 931 | $this->apitype = 'card'; |
|
| 932 | $this->module = 'membercard'; |
|
| 933 | $res = $this->_post('userinfo/get', $queryStr); |
|
| 934 | ||
| 935 | return $res; |
|
| 936 | } |
|
| 937 | ||
| 938 | /** |
|
| 939 | * 更新会员信息 |
|