Apply fixes from StyleCI

This commit is contained in:
Manish Verma
2016-12-13 13:14:54 +00:00
committed by StyleCI Bot
parent 857d3004eb
commit 88f3df2180
161 changed files with 4729 additions and 3879 deletions

View File

@@ -4,12 +4,13 @@ namespace App\Model\MailJob;
use Illuminate\Database\Eloquent\Model;
class Condition extends Model {
protected $table = "conditions";
class Condition extends Model
{
protected $table = 'conditions';
protected $fillable = ['job', 'value'];
public function getConditionValue($job) {
public function getConditionValue($job)
{
$value = ['condition' => '', 'at' => ''];
$condition = $this->where('job', $job)->first();
if ($condition) {
@@ -19,21 +20,24 @@ class Condition extends Model {
$value = ['condition' => $this->checkArray(0, $condition_value), 'at' => $this->checkArray(1, $condition_value)];
}
}
return $value;
}
public function checkArray($key,$array){
$value = "";
if(is_array($array)){
if(array_key_exists($key, $array)){
public function checkArray($key, $array)
{
$value = '';
if (is_array($array)) {
if (array_key_exists($key, $array)) {
$value = $array[$key];
}
}
return $value;
}
public function checkActiveJob() {
public function checkActiveJob()
{
$result = ['fetching' => '', 'notification' => '', 'work' => '', 'message' => '', 'remind' => ''];
$emails = new \App\Model\helpdesk\Settings\Email();
$email = $emails->find(1);
@@ -41,19 +45,19 @@ class Condition extends Model {
if ($email->email_fetching == 1) {
$result['fetching'] = true;
}
if($email->notification_cron==1){
if ($email->notification_cron == 1) {
$result['notification'] = true;
}
}
$works = new \App\Model\helpdesk\Workflow\WorkflowClose();
$work = $works->find(1);
//dd($work);
if($work){
if($work->condition==1){
if ($work) {
if ($work->condition == 1) {
$result['work'] = true;
}
}
return $result;
}
}