| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace App\Services;
- use App\Traits\ServiceAppAop;
- use App\OwnerSundryFeeDetail;
- use Carbon\Carbon;
- use Illuminate\Contracts\Pagination\LengthAwarePaginator;
- use Illuminate\Database\Eloquent\Builder;
- class OwnerSundryFeeDetailService implements \App\Interfaces\SettlementBillDetailInterface
- {
- use ServiceAppAop;
- protected $modelClass = OwnerSundryFeeDetail::class;
- /** @var OwnerBillReportArchiveService $archiveService */
- private $archiveService;
- const TYPE = '杂项费';
- public function get(array $kvPairs): LengthAwarePaginator
- {
- return $this->getSql($kvPairs['owner_id'], $kvPairs['counting_month'])->paginate($kvPairs['paginateParams']['paginate'] ?? 50);
- }
- public function getSql($owner_id, $counting_month): Builder
- {
- $start = Carbon::parse($counting_month)->startOfMonth()->startOfDay()->toDateTimeString();
- $end = Carbon::parse($counting_month)->endOfMonth()->endOfDay()->toDateTimeString();
- 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.
- }
- }
|