| @@ 276-284 (lines=9) @@ | ||
| 273 | * |
|
| 274 | * @return array |
|
| 275 | */ |
|
| 276 | public function deposit($cardId, $code) |
|
| 277 | { |
|
| 278 | $params = [ |
|
| 279 | 'card_id' => $cardId, |
|
| 280 | 'code' => $code, |
|
| 281 | ]; |
|
| 282 | ||
| 283 | return $this->parseJSON('json', [self::API_DEPOSIT_CODE, $params]); |
|
| 284 | } |
|
| 285 | ||
| 286 | /** |
|
| 287 | * 查询导入code数目. |
|
| @@ 293-300 (lines=8) @@ | ||
| 290 | * |
|
| 291 | * @return array |
|
| 292 | */ |
|
| 293 | public function getDepositedCount($cardId) |
|
| 294 | { |
|
| 295 | $params = [ |
|
| 296 | 'card_id' => $cardId, |
|
| 297 | ]; |
|
| 298 | ||
| 299 | return $this->parseJSON('json', [self::API_GET_DEPOSIT_COUNT, $params]); |
|
| 300 | } |
|
| 301 | ||
| 302 | /** |
|
| 303 | * 核查code接口. |
|
| @@ 310-318 (lines=9) @@ | ||
| 307 | * |
|
| 308 | * @return array |
|
| 309 | */ |
|
| 310 | public function checkCode($cardId, $code) |
|
| 311 | { |
|
| 312 | $params = [ |
|
| 313 | 'card_id' => $cardId, |
|
| 314 | 'code' => $code, |
|
| 315 | ]; |
|
| 316 | ||
| 317 | return $this->parseJSON('json', [self::API_CHECK_CODE, $params]); |
|
| 318 | } |
|
| 319 | ||
| 320 | /** |
|
| 321 | * 查询Code接口. |
|
| @@ 329-338 (lines=10) @@ | ||
| 326 | * |
|
| 327 | * @return array |
|
| 328 | */ |
|
| 329 | public function getCode($code, $checkConsume, $cardId) |
|
| 330 | { |
|
| 331 | $params = [ |
|
| 332 | 'code' => $code, |
|
| 333 | 'check_consume' => $checkConsume, |
|
| 334 | 'card_id' => $cardId, |
|
| 335 | ]; |
|
| 336 | ||
| 337 | return $this->parseJSON('json', [self::API_GET_CODE, $params]); |
|
| 338 | } |
|
| 339 | ||
| 340 | /** |
|
| 341 | * 核销Code接口. |
|
| @@ 348-356 (lines=9) @@ | ||
| 345 | * |
|
| 346 | * @return array |
|
| 347 | */ |
|
| 348 | public function consume($cardId, $code) |
|
| 349 | { |
|
| 350 | $params = [ |
|
| 351 | 'card_id' => $cardId, |
|
| 352 | 'code' => $code, |
|
| 353 | ]; |
|
| 354 | ||
| 355 | return $this->parseJSON('json', [self::API_CONSUME_CARD, $params]); |
|
| 356 | } |
|
| 357 | ||
| 358 | /** |
|
| 359 | * Code解码接口. |
|
| @@ 381-388 (lines=8) @@ | ||
| 378 | * |
|
| 379 | * @return array |
|
| 380 | */ |
|
| 381 | public function getHtml($cardId) |
|
| 382 | { |
|
| 383 | $params = [ |
|
| 384 | 'card_id' => $cardId, |
|
| 385 | ]; |
|
| 386 | ||
| 387 | return $this->parseJSON('json', [self::API_GET_HTML, $params]); |
|
| 388 | } |
|
| 389 | ||
| 390 | /** |
|
| 391 | * 设置测试白名单. |
|
| @@ 431-439 (lines=9) @@ | ||
| 428 | * |
|
| 429 | * @return array |
|
| 430 | */ |
|
| 431 | public function getUserCards($openid, $cardId = '') |
|
| 432 | { |
|
| 433 | $params = [ |
|
| 434 | 'openid' => $openid, |
|
| 435 | 'card_id' => $cardId, |
|
| 436 | ]; |
|
| 437 | ||
| 438 | return $this->parseJSON('json', [self::API_GET_CARD_LIST, $params]); |
|
| 439 | } |
|
| 440 | ||
| 441 | /** |
|
| 442 | * 查看卡券详情. |
|
| @@ 448-455 (lines=8) @@ | ||
| 445 | * |
|
| 446 | * @return array |
|
| 447 | */ |
|
| 448 | public function getCard($cardId) |
|
| 449 | { |
|
| 450 | $params = [ |
|
| 451 | 'card_id' => $cardId, |
|
| 452 | ]; |
|
| 453 | ||
| 454 | return $this->parseJSON('json', [self::API_GET_CARD, $params]); |
|
| 455 | } |
|
| 456 | ||
| 457 | /** |
|
| 458 | * 批量查询卡列表. |
|
| @@ 510-518 (lines=9) @@ | ||
| 507 | * |
|
| 508 | * @return array |
|
| 509 | */ |
|
| 510 | public function setPayCell($cardId, $isOpen = true) |
|
| 511 | { |
|
| 512 | $params = [ |
|
| 513 | 'card_id' => $cardId, |
|
| 514 | 'is_open' => $isOpen, |
|
| 515 | ]; |
|
| 516 | ||
| 517 | return $this->parseJSON('json', [self::API_SET_PAY_CELL, $params]); |
|
| 518 | } |
|
| 519 | ||
| 520 | /** |
|
| 521 | * 增加库存. |
|
| @@ 575-584 (lines=10) @@ | ||
| 572 | * |
|
| 573 | * @return array |
|
| 574 | */ |
|
| 575 | public function updateCode($code, $newCode, $cardId = []) |
|
| 576 | { |
|
| 577 | $params = [ |
|
| 578 | 'code' => $code, |
|
| 579 | 'new_code' => $newCode, |
|
| 580 | 'card_id' => $cardId, |
|
| 581 | ]; |
|
| 582 | ||
| 583 | return $this->parseJSON('json', [self::API_UPDATE_CODE, $params]); |
|
| 584 | } |
|
| 585 | ||
| 586 | /** |
|
| 587 | * 删除卡券接口. |
|
| @@ 593-600 (lines=8) @@ | ||
| 590 | * |
|
| 591 | * @return array |
|
| 592 | */ |
|
| 593 | public function delete($cardId) |
|
| 594 | { |
|
| 595 | $params = [ |
|
| 596 | 'card_id' => $cardId, |
|
| 597 | ]; |
|
| 598 | ||
| 599 | return $this->parseJSON('json', [self::API_DELETE_CARD, $params]); |
|
| 600 | } |
|
| 601 | ||
| 602 | /** |
|
| 603 | * 设置卡券失效. |
|
| @@ 610-618 (lines=9) @@ | ||
| 607 | * |
|
| 608 | * @return array |
|
| 609 | */ |
|
| 610 | public function disable($code, $cardId = '') |
|
| 611 | { |
|
| 612 | $params = [ |
|
| 613 | 'code' => $code, |
|
| 614 | 'card_id' => $cardId, |
|
| 615 | ]; |
|
| 616 | ||
| 617 | return $this->parseJSON('json', [self::API_DISABLE_CARD, $params]); |
|
| 618 | } |
|
| 619 | ||
| 620 | /** |
|
| 621 | * 会员卡接口激活. |
|
| @@ 656-664 (lines=9) @@ | ||
| 653 | * |
|
| 654 | * @return array |
|
| 655 | */ |
|
| 656 | public function getMemberCardUser($cardId, $code) |
|
| 657 | { |
|
| 658 | $params = [ |
|
| 659 | 'card_id' => $cardId, |
|
| 660 | 'code' => $code, |
|
| 661 | ]; |
|
| 662 | ||
| 663 | return $this->parseJSON('json', [self::API_GET_MEMBER_USER_INFO, $params]); |
|
| 664 | } |
|
| 665 | ||
| 666 | /** |
|
| 667 | * 更新会员信息. |
|