增加自媒体渠道
This commit is contained in:
@@ -8,6 +8,7 @@ use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsExtendInterface;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\finance\AccountCost;
|
||||
use app\common\service\qywx\MediaChannelService;
|
||||
|
||||
class AccountCostLists extends BaseAdminDataLists implements ListsSearchInterface, ListsExtendInterface
|
||||
{
|
||||
@@ -30,6 +31,10 @@ class AccountCostLists extends BaseAdminDataLists implements ListsSearchInterfac
|
||||
$query->where('cost_date', '<=', $this->params['end_date']);
|
||||
}
|
||||
|
||||
if (!empty($this->params['media_channel_code'])) {
|
||||
$query->where('media_channel_code', trim((string) $this->params['media_channel_code']));
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
@@ -49,11 +54,11 @@ class AccountCostLists extends BaseAdminDataLists implements ListsSearchInterfac
|
||||
|
||||
public function extend(): array
|
||||
{
|
||||
$baseQuery = $this->baseQuery();
|
||||
|
||||
return [
|
||||
'total_amount' => round((float) $baseQuery->sum('amount'), 2),
|
||||
'days_count' => (int) $baseQuery->count(),
|
||||
'total_amount' => round((float) $this->baseQuery()->sum('amount'), 2),
|
||||
'days_count' => (int) $this->baseQuery()->distinct(true)->count('cost_date'),
|
||||
'media_channel_options' => MediaChannelService::getOptions(),
|
||||
'default_media_channel_code' => MediaChannelService::getDefaultCode(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user