-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from marshallgosling/dev
Pre-2.3
- Loading branch information
Showing
48 changed files
with
865 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
namespace App\Admin\Actions\Channel; | ||
|
||
use App\Models\Channel; | ||
use App\Tools\ChannelDatabase; | ||
use Illuminate\Contracts\Support\Renderable; | ||
|
||
class CheckEpg implements Renderable | ||
{ | ||
|
||
public function render($key = null) | ||
{ | ||
$ch = Channel::find($key); | ||
$msg = ''; | ||
$label = ''; | ||
if(!$ch) $data = '<tr><td>播出编单不存在</td></tr>'; | ||
else { | ||
$data = ChannelDatabase::checkEpgWithChannel($ch); | ||
|
||
if( $data['result']) { | ||
$label = '<p>播出编单:'.Channel::GROUPS[$ch->name].' 日期:'.$ch->air_date.' 文件:'.$ch->name.'_'.$ch->air_date.'.xml 检查结果:<span class="label label-success">通过</span> 数据一致</p>'; | ||
} | ||
else { | ||
$label = '<p>播出编单:'.Channel::GROUPS[$ch->name].' 日期:'.$ch->air_date.' 文件:'.$ch->name.'_'.$ch->air_date.'.xml 检查结果:<span class="label label-danger">不通过</span> 数据不一致</p>'; | ||
$msg = "<tr><td>播放编单数据和格非串联单xml文件存在差异,请重新“加锁”</td></tr>"; | ||
$msg .= "<tr><td>原因:".$data['msg']."</td></tr>"; | ||
$msg .= "<tr><td>差异数据:</td></tr>"; | ||
$item = $data['items'][0]; | ||
$msg .= "<tr><td>编单数据: {$item['start_at']} - {$item['name']} - {$item['duration']}</td></tr>"; | ||
if(count($data['items']) == 2) | ||
{ | ||
$item = $data['items'][1]; | ||
$msg .= "<tr><td>串联单数据:{$item['start_at']} - {$item['name']} - {$item['duration']}</td></tr>"; | ||
} | ||
} | ||
|
||
} | ||
|
||
$html = <<<HTML | ||
{$label} | ||
<div class="table-responsive"> | ||
<table class="table table-striped"> | ||
{$msg} | ||
</table> | ||
</div> | ||
HTML; | ||
|
||
return $html; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace App\Admin\Actions\Channel; | ||
|
||
use App\Jobs\EpgJob; | ||
use App\Jobs\StatisticJob; | ||
use App\Models\Channel; | ||
use Encore\Admin\Actions\RowAction; | ||
|
||
class Lock extends RowAction | ||
{ | ||
public $name = '加/解锁'; | ||
|
||
public function handle(Channel $model) | ||
{ | ||
// $model ... | ||
if(!in_array($model->status, [Channel::STATUS_READY, Channel::STATUS_DISTRIBUTE])) { | ||
return $this->response()->error(__('频道编单状态异常'))->refresh(); | ||
} | ||
|
||
$lock = $model->lock_status; | ||
|
||
$model->lock_status = $lock == Channel::LOCK_EMPTY ? Channel::LOCK_ENABLE : Channel::LOCK_EMPTY; | ||
if($model->comment == '编单已完成,请加锁并审核!') $model->comment = ''; | ||
|
||
$model->save(); | ||
|
||
if($model->lock_status == Channel::LOCK_ENABLE) { | ||
StatisticJob::dispatch($model->id); | ||
EpgJob::dispatch($model->id); | ||
} | ||
|
||
$lock = $model->lock_status; | ||
\App\Tools\Operation::log($this->name, 'channel/BatchLock:'.$lock, 'action', $model); | ||
|
||
return $this->response()->success($lock?"加锁成功":"解锁成功")->refresh(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.