<?php
/**
 * Created by PhpStorm.
 * User: tandunzhao
 * Date: 2017/12/7
 * Time: 下午2:25
 */

namespace App\Modules\Finance\Services;


use App\Modules\Finance\Models\FinanceMerchantStat;

class FinanceMerchantStatService
{

    /**
     * 获取一条记录
     * @param string $channel_id
     * @param string $pay_merchant_source
     * @return mixed
     */
    public static function getFinanceMerchantStatSingle($channel_id = '', $pay_merchant_source = '') {
        return FinanceMerchantStat::getFinanceMerchantStatSingle($channel_id, $pay_merchant_source);
    }

    /**
     * 添加更新渠道支付通道相关金钱统计
     * @param $channel_id
     * @param $pay_merchant_source
     * @param $amount  添加正数，减少负数
     * @return mixed
     */
    public static function createOrUpdate($channel_id, $pay_merchant_source, $amount) {
        return FinanceMerchantStat::createOrUpdate($channel_id, $pay_merchant_source, $amount);
    }

    /**
     * 获取除了$pay_merchant_source之外的渠道总额
     * @param string $channel_id
     * @param string $pay_merchant_source
     * @return mixed
     */
    public static function getEnableWithdrawalAmountSumIgnoreSource($channel_id = '', $pay_merchant_source = '') {
        return FinanceMerchantStat::getEnableWithdrawalAmountSumIgnoreSource($channel_id, $pay_merchant_source);
    }
    /**
     * 获取除了 $pay_merchant_source之外的渠道总额
     * @param string $channel_id
     * @param array $pay_merchant_sources
     * @return mixed
     */
    public static function getEnableWithdrawalAmountSumIgnoreSourceArray($channel_id = '', $pay_merchant_sources = []) {
        return FinanceMerchantStat::getEnableWithdrawalAmountSumIgnoreSourceArray($channel_id, $pay_merchant_sources);
    }

    /**
     * 获取支付渠道总额
     * @param string $channel_id
     * @param string $pay_merchant_source
     * @return mixed
     */
    public static function getEnableWithdrawalAmountSum($channel_id = '', $pay_merchant_source = '') {
        return FinanceMerchantStat::getEnableWithdrawalAmountSum($channel_id, $pay_merchant_source);
    }

    /**
     * 获取列表
     * @param string $channel_id 可空
     * @param string $pay_merchant_source 可空
     * @return mixed
     */
    public static function getFinanceMerchantStatList($channel_id = '', $pay_merchant_source = '') {
        return FinanceMerchantStat::getFinanceMerchantStatList($channel_id, $pay_merchant_source);
    }
    /**
     * 获取列表
     * @param string $channel_id 可空
     * @param array $pay_merchant_sources 可空
     * @return mixed
     */
    public static function getFinanceMerchantStatListIgnoreSourceArray($channel_id = '', $pay_merchant_sources = []) {
        return FinanceMerchantStat::getFinanceMerchantStatListIgnoreSourceArray($channel_id, $pay_merchant_sources);
    }
    /**
     * 获取列表
     * @param string $channel_id 可空
     * @param string $pay_merchant_source 可空
     * @return mixed
     */
    public static function getFinanceMerchantStatListIgnoreSource($channel_id = '', $pay_merchant_source = '') {
        return FinanceMerchantStat::getFinanceMerchantStatListIgnoreSource($channel_id, $pay_merchant_source);
    }
}