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

namespace App\Modules\Finance\Services;


use App\Modules\Finance\Models\Liquidation;

class LiquidationService
{

    /**
     * 保存清算明细
     * @param $channel_id 渠道ID
     * @param $pay_merchant_source 渠道支付通道
     * @param $amount 清算金额
     * @param $payment_id 打款ID
     * @param string $remark 备注
     * @return mixed
     */
    public static function addLiquidation($channel_id, $pay_merchant_source, $amount, $payment_id, $remark = '') {
        $date = date("Y-m-d H:i:s");

        return Liquidation::addLiquidation($channel_id, $pay_merchant_source, $amount, $date, $payment_id, $remark);
    }


    /**
     * 清算明细表列表
     * @param $params[]
     *                  channel_id:渠道ID 可选
     *                  channel_name:渠道名称 可选
     *                  pay_merchant_source 支付通道渠道(可不传，获取所有通道) 可选
     *                  start_date:开始时间 可选
     *                  end_date:结束时间 可选
     *                  search_name: 搜索名称
     * @param $isAll
     * @return mixed
     */
    public static function getLiquidationList($params=[], $isAll = false) {

        return Liquidation::getLiquidationList($params, $isAll);
    }
}