mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -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;
|
<?php namespace Visiosoft\AdvsModule\Adv\Table\Handler;
|
||||||
|
|
||||||
|
use Anomaly\SettingsModule\Setting\Contract\SettingRepositoryInterface;
|
||||||
use Anomaly\Streams\Platform\Ui\Table\Component\Action\ActionHandler;
|
use Anomaly\Streams\Platform\Ui\Table\Component\Action\ActionHandler;
|
||||||
use Visiosoft\AdvsModule\Adv\Table\AdvTableBuilder;
|
use Visiosoft\AdvsModule\Adv\Table\AdvTableBuilder;
|
||||||
|
|
||||||
|
|
||||||
class Approve extends ActionHandler
|
class Approve extends ActionHandler
|
||||||
{
|
{
|
||||||
public function handle(AdvTableBuilder $builder, array $selected)
|
public function handle(AdvTableBuilder $builder, array $selected, SettingRepositoryInterface $settingRepository)
|
||||||
{
|
{
|
||||||
$model = $builder->getTableModel();
|
$model = $builder->getTableModel();
|
||||||
|
|
||||||
foreach ($selected as $id) {
|
foreach ($selected as $id) {
|
||||||
|
$defaultAdPublishTime = $settingRepository->value('visiosoft.module.advs::default_published_time');
|
||||||
|
|
||||||
$entry = $model->find($id);
|
$model->newQuery()->find($id)->update([
|
||||||
|
'status' => 'approved',
|
||||||
$entry->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')
|
||||||
$entry->update();
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($selected) {
|
if ($selected) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user