Code Duplication    Length = 27-27 lines in 2 locations

src/API/CardApi.php 2 locations

@@ 748-774 (lines=27) @@
745
     *
746
     * @return array
747
     */
748
    public function getcardbizuininfo($begin_date, $end_date, $cond_source = 0)
749
    {
750
        if (empty($begin_date) || empty($end_date) || !is_numeric($cond_source) || $cond_source < 0 || $cond_source > 1) {
751
            $this->setError('参数错误');
752
753
            return false;
754
        }
755
756
        if (is_numeric($begin_date)) {
757
            $begin_date = date('Y-m-d', $begin_date);
758
        }
759
760
        if (is_numeric($end_date)) {
761
            $end_date = date('Y-m-d', $end_date);
762
        }
763
764
        $queryStr                = [];
765
        $queryStr['begin_date']  = $begin_date;
766
        $queryStr['end_date']    = $end_date;
767
        $queryStr['cond_source'] = intval($cond_source);
768
769
        $this->apitype = 'datacube';
770
        $this->module  = 'getcardbizuininfo';
771
        $res           = $this->_post('', $queryStr);
772
773
        return $res;
774
    }
775
776
    /**
777
     * 获取免费券数据接口
@@ 827-853 (lines=27) @@
824
     *
825
     * @return array
826
     */
827
    public function getcardmembercardinfo($begin_date, $end_date, $cond_source = 0)
828
    {
829
        if (empty($begin_date) || empty($end_date) || !is_numeric($cond_source) || $cond_source < 0 || $cond_source > 1) {
830
            $this->setError('参数错误');
831
832
            return false;
833
        }
834
835
        if (is_numeric($begin_date)) {
836
            $begin_date = date('Y-m-d', $begin_date);
837
        }
838
839
        if (is_numeric($end_date)) {
840
            $end_date = date('Y-m-d', $end_date);
841
        }
842
843
        $queryStr                = [];
844
        $queryStr['begin_date']  = $begin_date;
845
        $queryStr['end_date']    = $end_date;
846
        $queryStr['cond_source'] = intval($cond_source);
847
848
        $this->apitype = 'datacube';
849
        $this->module  = 'getcardmembercardinfo';
850
        $res           = $this->_post('', $queryStr);
851
852
        return $res;
853
    }
854
855
    /**
856
     * 会员卡接口激活