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

namespace App\Modules\Finance\Services;


use App\Modules\Finance\Models\LiquidatedStat;

class LiquidatedStatService
{

    /**
     * 添加更新清算汇总
     * @param $amount 添加正数，减少负数
     * @param $pay_merchant_source
     * @return mixed
     */
    public static function createOrUpdate($pay_merchant_source, $amount) {
        return LiquidatedStat::createOrUpdate($pay_merchant_source, $amount);
    }

    /**
     * 更新支付渠道余额
     * @param $pay_merchant_source
     * @param $amount
     * @return mixed
     */
    public static function updateAccountBalanceAmount($pay_merchant_source, $amount) {
        return LiquidatedStat::updateAccountBalanceAmount($pay_merchant_source, $amount);
    }
    /**
     * 更新支付渠道余额当天
     * @param $pay_merchant_source
     * @param $amount
     * @return mixed
     */
    public static function updateAccountBalanceAmountDay($pay_merchant_source, $amount) {
        return LiquidatedStat::updateAccountBalanceAmountDay($pay_merchant_source, $amount);
    }

    /**
     * 清算汇总列表
     * @return mixed
     */
    public static function getLiquidatedStatList() {
        return LiquidatedStat::getLiquidatedStatList();
    }

    /**
     * 根据支付通道获取
     * @param $pay_merchant_source
     * @return mixed
     */
    public static function getLiquidatedStatSingleBySource($pay_merchant_source) {
        return LiquidatedStat::getLiquidatedStatSingleBySource($pay_merchant_source);
    }
}