<?php

namespace App\Services;

use App\Services\common\QueryService;
use App\WaybillFinancialSnapshot;
use App\Traits\ServiceAppAop;


class WaybillFinancialService
{
    use ServiceAppAop;
    protected $modelClass=WaybillFinancial::class;
    public function conditionQuery(array $param){
        $waybillFinancialSnapshots=WaybillFinancialSnapshot::query();
        $columnQueryRules=[
            'created_at_start' => ['alias' => 'created_at','startDate' => " 00:00:00"],
            'created_at_end' => ['alias' => 'created_at','endDate' => " 23:59:59"],
            'waybill_id' => ['multi' => ','],
        ];
        return app(QueryService::class)->query($param,$waybillFinancialSnapshots,$columnQueryRules);
    }


    /**
     * @param array $param
     * @return string
     */
    public function getSql(array $param){
        return $this->conditionQuery($param)->sql();
    }

}
