getSql($kvPairs['owner_id'], $kvPairs['counting_month'])->paginate($kvPairs['paginateParams']['paginate'] ?? 50); } public function getSql($owner_id, $counting_month): Builder { list($start, $end) = $this->getStartAndEnd($counting_month); return OwnerSundryFeeDetail::query() ->with(['owner', 'logistic']) ->where('owner_id', $owner_id) ->whereBetween('created_at', [$start, $end]); } public function switchType($type) { // TODO: Implement switchType() method. } public function buildExport($details): array { // TODO: Implement buildExport() method. } public function add(array $model) { // TODO: Implement add() method. } public function getTotalFee($owner_id, $counting_month) { list($start, $end) = $this->getStartAndEnd($counting_month); return OwnerSundryFeeDetail::query() ->selectRaw("type,sum(fee) as fee") ->where('owner_id', $owner_id) ->whereBetween('created_at', [$start, $end]) ->groupBy('type') ->get(); } public function recordReport($counting_month = null,array $ownerIds = []) { // TODO: Implement recordReport() method. } }