| @@ 275-283 (lines=9) @@ | ||
| 272 | * |
|
| 273 | * @return array |
|
| 274 | */ |
|
| 275 | public function deposit($cardId, $code) |
|
| 276 | { |
|
| 277 | $params = [ |
|
| 278 | 'card_id' => $cardId, |
|
| 279 | 'code' => $code, |
|
| 280 | ]; |
|
| 281 | ||
| 282 | return $this->parseJSON('json', [self::API_DEPOSIT_CODE, $params]); |
|
| 283 | } |
|
| 284 | ||
| 285 | /** |
|
| 286 | * 查询导入code数目. |
|
| @@ 292-299 (lines=8) @@ | ||
| 289 | * |
|
| 290 | * @return array |
|
| 291 | */ |
|
| 292 | public function getDepositedCount($cardId) |
|
| 293 | { |
|
| 294 | $params = [ |
|
| 295 | 'card_id' => $cardId, |
|
| 296 | ]; |
|
| 297 | ||
| 298 | return $this->parseJSON('json', [self::API_GET_DEPOSIT_COUNT, $params]); |
|
| 299 | } |
|
| 300 | ||
| 301 | /** |
|
| 302 | * 核查code接口. |
|
| @@ 309-317 (lines=9) @@ | ||
| 306 | * |
|
| 307 | * @return array |
|
| 308 | */ |
|
| 309 | public function checkCode($cardId, $code) |
|
| 310 | { |
|
| 311 | $params = [ |
|
| 312 | 'card_id' => $cardId, |
|
| 313 | 'code' => $code, |
|
| 314 | ]; |
|
| 315 | ||
| 316 | return $this->parseJSON('json', [self::API_CHECK_CODE, $params]); |
|
| 317 | } |
|
| 318 | ||
| 319 | /** |
|
| 320 | * 查询Code接口. |
|
| @@ 415-423 (lines=9) @@ | ||
| 412 | * |
|
| 413 | * @return array |
|
| 414 | */ |
|
| 415 | public function getUserCards($openid, $cardId = '') |
|
| 416 | { |
|
| 417 | $params = [ |
|
| 418 | 'openid' => $openid, |
|
| 419 | 'card_id' => $cardId, |
|
| 420 | ]; |
|
| 421 | ||
| 422 | return $this->parseJSON('json', [self::API_GET_CARD_LIST, $params]); |
|
| 423 | } |
|
| 424 | ||
| 425 | /** |
|
| 426 | * 查看卡券详情. |
|
| @@ 432-439 (lines=8) @@ | ||
| 429 | * |
|
| 430 | * @return array |
|
| 431 | */ |
|
| 432 | public function getCard($cardId) |
|
| 433 | { |
|
| 434 | $params = [ |
|
| 435 | 'card_id' => $cardId, |
|
| 436 | ]; |
|
| 437 | ||
| 438 | return $this->parseJSON('json', [self::API_GET_CARD, $params]); |
|
| 439 | } |
|
| 440 | ||
| 441 | /** |
|
| 442 | * 批量查询卡列表. |
|
| @@ 494-502 (lines=9) @@ | ||
| 491 | * |
|
| 492 | * @return array |
|
| 493 | */ |
|
| 494 | public function setPayCell($cardId, $isOpen = true) |
|
| 495 | { |
|
| 496 | $params = [ |
|
| 497 | 'card_id' => $cardId, |
|
| 498 | 'is_open' => $isOpen, |
|
| 499 | ]; |
|
| 500 | ||
| 501 | return $this->parseJSON('json', [self::API_SET_PAY_CELL, $params]); |
|
| 502 | } |
|
| 503 | ||
| 504 | /** |
|
| 505 | * 增加库存 |
|
| @@ 328-337 (lines=10) @@ | ||
| 325 | * |
|
| 326 | * @return array |
|
| 327 | */ |
|
| 328 | public function getCode($code, $checkConsume, $cardId) |
|
| 329 | { |
|
| 330 | $params = [ |
|
| 331 | 'code' => $code, |
|
| 332 | 'check_consume' => $checkConsume, |
|
| 333 | 'card_id' => $cardId, |
|
| 334 | ]; |
|
| 335 | ||
| 336 | return $this->parseJSON('json', [self::API_GET_CODE, $params]); |
|
| 337 | } |
|
| 338 | ||
| 339 | /** |
|
| 340 | * 核销Code接口. |
|
| @@ 347-355 (lines=9) @@ | ||
| 344 | * |
|
| 345 | * @return array |
|
| 346 | */ |
|
| 347 | public function consume($cardId, $code) |
|
| 348 | { |
|
| 349 | $params = [ |
|
| 350 | 'card_id' => $cardId, |
|
| 351 | 'code' => $code, |
|
| 352 | ]; |
|
| 353 | ||
| 354 | return $this->parseJSON('json', [self::API_CONSUME_CARD, $params]); |
|
| 355 | } |
|
| 356 | ||
| 357 | /** |
|
| 358 | * Code解码接口. |
|
| @@ 380-387 (lines=8) @@ | ||
| 377 | * |
|
| 378 | * @return array |
|
| 379 | */ |
|
| 380 | public function getHtml($cardId) |
|
| 381 | { |
|
| 382 | $params = [ |
|
| 383 | 'card_id' => $cardId, |
|
| 384 | ]; |
|
| 385 | ||
| 386 | return $this->parseJSON('json', [self::API_GET_HTML, $params]); |
|
| 387 | } |
|
| 388 | ||
| 389 | /** |
|
| 390 | * 设置测试白名单. |
|
| @@ 559-568 (lines=10) @@ | ||
| 556 | * |
|
| 557 | * @return array |
|
| 558 | */ |
|
| 559 | public function updateCode($code, $newCode, $cardId = []) |
|
| 560 | { |
|
| 561 | $params = [ |
|
| 562 | 'code' => $code, |
|
| 563 | 'new_code' => $newCode, |
|
| 564 | 'card_id' => $cardId, |
|
| 565 | ]; |
|
| 566 | ||
| 567 | return $this->parseJSON('json', [self::API_UPDATE_CODE, $params]); |
|
| 568 | } |
|
| 569 | ||
| 570 | /** |
|
| 571 | * 删除卡券接口. |
|
| @@ 577-584 (lines=8) @@ | ||
| 574 | * |
|
| 575 | * @return array |
|
| 576 | */ |
|
| 577 | public function delete($cardId) |
|
| 578 | { |
|
| 579 | $params = [ |
|
| 580 | 'card_id' => $cardId, |
|
| 581 | ]; |
|
| 582 | ||
| 583 | return $this->parseJSON('json', [self::API_DELETE_CARD, $params]); |
|
| 584 | } |
|
| 585 | ||
| 586 | /** |
|
| 587 | * 设置卡券失效. |
|
| @@ 594-602 (lines=9) @@ | ||
| 591 | * |
|
| 592 | * @return array |
|
| 593 | */ |
|
| 594 | public function disable($code, $cardId = '') |
|
| 595 | { |
|
| 596 | $params = [ |
|
| 597 | 'code' => $code, |
|
| 598 | 'card_id' => $cardId, |
|
| 599 | ]; |
|
| 600 | ||
| 601 | return $this->parseJSON('json', [self::API_DISABLE_CARD, $params]); |
|
| 602 | } |
|
| 603 | ||
| 604 | /** |
|
| 605 | * 会员卡接口激活. |
|
| @@ 625-631 (lines=7) @@ | ||
| 622 | * |
|
| 623 | * @return array |
|
| 624 | */ |
|
| 625 | public function activateUserForm($cardId, array $requiredForm = [], array $optionalForm = []) |
|
| 626 | { |
|
| 627 | ||
| 628 | $params = array_merge(['card_id' => $cardId], $requiredForm, $optionalForm); |
|
| 629 | ||
| 630 | return $this->parseJSON('json', [self::API_ACTIVATE_USER_FORM, $params]); |
|
| 631 | } |
|
| 632 | ||
| 633 | /** |
|
| 634 | * 拉取会员信息接口. |
|
| @@ 641-649 (lines=9) @@ | ||
| 638 | * |
|
| 639 | * @return array |
|
| 640 | */ |
|
| 641 | public function getMemberCardUser($cardId, $code) |
|
| 642 | { |
|
| 643 | $params = [ |
|
| 644 | 'card_id' => $cardId, |
|
| 645 | 'code' => $code, |
|
| 646 | ]; |
|
| 647 | ||
| 648 | return $this->parseJSON('json', [self::API_GET_MEMBER_USER_INFO, $params]); |
|
| 649 | } |
|
| 650 | ||
| 651 | /** |
|
| 652 | * 更新会员信息. |
|