mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
Merge pull request #371 from openclassify/dia
#926 Toplu ilan onaylamada finish at eklenmiyor.
This commit is contained in:
commit
92a92e1042
@ -1,22 +1,24 @@
|
||||
<?php namespace Visiosoft\AdvsModule\Adv\Table\Handler;
|
||||
|
||||
use Anomaly\SettingsModule\Setting\Contract\SettingRepositoryInterface;
|
||||
use Anomaly\Streams\Platform\Ui\Table\Component\Action\ActionHandler;
|
||||
use Visiosoft\AdvsModule\Adv\Table\AdvTableBuilder;
|
||||
|
||||
|
||||
class Approve extends ActionHandler
|
||||
{
|
||||
public function handle(AdvTableBuilder $builder, array $selected)
|
||||
public function handle(AdvTableBuilder $builder, array $selected, SettingRepositoryInterface $settingRepository)
|
||||
{
|
||||
$model = $builder->getTableModel();
|
||||
|
||||
foreach ($selected as $id) {
|
||||
$defaultAdPublishTime = $settingRepository->value('visiosoft.module.advs::default_published_time');
|
||||
|
||||
$entry = $model->find($id);
|
||||
|
||||
$entry->status = 'approved';
|
||||
|
||||
$entry->update();
|
||||
$model->newQuery()->find($id)->update([
|
||||
'status' => 'approved',
|
||||
'finish_at' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . ' + ' . $defaultAdPublishTime . ' day')),
|
||||
'publish_at' => date('Y-m-d H:i:s')
|
||||
]);
|
||||
}
|
||||
|
||||
if ($selected) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user