Code Duplication    Length = 8-10 lines in 12 locations

src/Card/Card.php 12 locations

@@ 279-287 (lines=9) @@
276
     *
277
     * @return \EasyWeChat\Support\Collection
278
     */
279
    public function deposit($cardId, $code)
280
    {
281
        $params = [
282
            'card_id' => $cardId,
283
            'code' => $code,
284
        ];
285
286
        return $this->parseJSON('json', [self::API_DEPOSIT_CODE, $params]);
287
    }
288
289
    /**
290
     * 查询导入code数目.
@@ 296-303 (lines=8) @@
293
     *
294
     * @return \EasyWeChat\Support\Collection
295
     */
296
    public function getDepositedCount($cardId)
297
    {
298
        $params = [
299
            'card_id' => $cardId,
300
        ];
301
302
        return $this->parseJSON('json', [self::API_GET_DEPOSIT_COUNT, $params]);
303
    }
304
305
    /**
306
     * 核查code接口.
@@ 313-321 (lines=9) @@
310
     *
311
     * @return \EasyWeChat\Support\Collection
312
     */
313
    public function checkCode($cardId, $code)
314
    {
315
        $params = [
316
            'card_id' => $cardId,
317
            'code' => $code,
318
        ];
319
320
        return $this->parseJSON('json', [self::API_CHECK_CODE, $params]);
321
    }
322
323
    /**
324
     * 查询Code接口.
@@ 332-341 (lines=10) @@
329
     *
330
     * @return \EasyWeChat\Support\Collection
331
     */
332
    public function getCode($code, $checkConsume, $cardId)
333
    {
334
        $params = [
335
            'code' => $code,
336
            'check_consume' => $checkConsume,
337
            'card_id' => $cardId,
338
        ];
339
340
        return $this->parseJSON('json', [self::API_GET_CODE, $params]);
341
    }
342
343
    /**
344
     * 核销Code接口.
@@ 391-398 (lines=8) @@
388
     *
389
     * @return \EasyWeChat\Support\Collection
390
     */
391
    public function getHtml($cardId)
392
    {
393
        $params = [
394
            'card_id' => $cardId,
395
        ];
396
397
        return $this->parseJSON('json', [self::API_GET_HTML, $params]);
398
    }
399
400
    /**
401
     * 设置测试白名单.
@@ 440-448 (lines=9) @@
437
     *
438
     * @return \EasyWeChat\Support\Collection
439
     */
440
    public function getUserCards($openid, $cardId = '')
441
    {
442
        $params = [
443
            'openid' => $openid,
444
            'card_id' => $cardId,
445
        ];
446
447
        return $this->parseJSON('json', [self::API_GET_CARD_LIST, $params]);
448
    }
449
450
    /**
451
     * 查看卡券详情.
@@ 457-464 (lines=8) @@
454
     *
455
     * @return \EasyWeChat\Support\Collection
456
     */
457
    public function getCard($cardId)
458
    {
459
        $params = [
460
            'card_id' => $cardId,
461
        ];
462
463
        return $this->parseJSON('json', [self::API_GET_CARD, $params]);
464
    }
465
466
    /**
467
     * 批量查询卡列表.
@@ 521-529 (lines=9) @@
518
     *
519
     * @return \EasyWeChat\Support\Collection
520
     */
521
    public function setPayCell($cardId, $isOpen = true)
522
    {
523
        $params = [
524
            'card_id' => $cardId,
525
            'is_open' => $isOpen,
526
        ];
527
528
        return $this->parseJSON('json', [self::API_SET_PAY_CELL, $params]);
529
    }
530
531
    /**
532
     * 增加库存.
@@ 586-595 (lines=10) @@
583
     *
584
     * @return \EasyWeChat\Support\Collection
585
     */
586
    public function updateCode($code, $newCode, $cardId = [])
587
    {
588
        $params = [
589
            'code' => $code,
590
            'new_code' => $newCode,
591
            'card_id' => $cardId,
592
        ];
593
594
        return $this->parseJSON('json', [self::API_UPDATE_CODE, $params]);
595
    }
596
597
    /**
598
     * 删除卡券接口.
@@ 604-611 (lines=8) @@
601
     *
602
     * @return \EasyWeChat\Support\Collection
603
     */
604
    public function delete($cardId)
605
    {
606
        $params = [
607
            'card_id' => $cardId,
608
        ];
609
610
        return $this->parseJSON('json', [self::API_DELETE_CARD, $params]);
611
    }
612
613
    /**
614
     * 设置卡券失效.
@@ 621-629 (lines=9) @@
618
     *
619
     * @return \EasyWeChat\Support\Collection
620
     */
621
    public function disable($code, $cardId = '')
622
    {
623
        $params = [
624
            'code' => $code,
625
            'card_id' => $cardId,
626
        ];
627
628
        return $this->parseJSON('json', [self::API_DISABLE_CARD, $params]);
629
    }
630
631
    /**
632
     * 会员卡接口激活.
@@ 671-679 (lines=9) @@
668
     *
669
     * @return \EasyWeChat\Support\Collection
670
     */
671
    public function getMemberCardUser($cardId, $code)
672
    {
673
        $params = [
674
            'card_id' => $cardId,
675
            'code' => $code,
676
        ];
677
678
        return $this->parseJSON('json', [self::API_GET_MEMBER_USER_INFO, $params]);
679
    }
680
681
    /**
682
     * 更新会员信息.