Fix indentation issues

This commit is contained in:
Tautvidas Sipavičius
2016-06-30 13:29:23 +03:00
parent 8a9d14319b
commit b7d8d482fe
14 changed files with 97 additions and 76 deletions

View File

@ -14,20 +14,16 @@ class BootStrapMenu {
return ($this->daemon) ? return ($this->daemon) ?
array_merge( array_merge(
array( array(
'timeSinceStart' => 'timeSinceStart' => Carbon::createFromFormat(
Carbon::createFromFormat(
'Y-m-d H:i:s', 'Y-m-d H:i:s',
$this->daemon->created_at, $this->daemon->created_at,
'UTC' 'UTC'
) )->diffForHumans(),
->diffForHumans(), 'timeSinceUpdate' => Carbon::createFromFormat(
'timeSinceUpdate' =>
Carbon::createFromFormat(
'Y-m-d H:i:s', 'Y-m-d H:i:s',
$this->daemon->updated_at, $this->daemon->updated_at,
'UTC' 'UTC'
) )->diffForHumans()
->diffForHumans()
), ),
json_decode($this->daemon->value, true) json_decode($this->daemon->value, true)
) : ) :

View File

@ -287,12 +287,20 @@ class Newsletter extends Model {
$orm = $orm $orm = $orm
->left_outer_join( ->left_outer_join(
MP_NEWSLETTER_OPTION_TABLE, MP_NEWSLETTER_OPTION_TABLE,
array(MP_NEWSLETTERS_TABLE.'.id', '=', array(
MP_NEWSLETTER_OPTION_TABLE.'.newsletter_id')) MP_NEWSLETTERS_TABLE.'.id',
'=',
MP_NEWSLETTER_OPTION_TABLE.'.newsletter_id'
)
)
->left_outer_join( ->left_outer_join(
MP_NEWSLETTER_OPTION_FIELDS_TABLE, MP_NEWSLETTER_OPTION_FIELDS_TABLE,
array(MP_NEWSLETTER_OPTION_FIELDS_TABLE.'.id','=', array(
MP_NEWSLETTER_OPTION_TABLE.'.option_field_id')) MP_NEWSLETTER_OPTION_FIELDS_TABLE.'.id',
'=',
MP_NEWSLETTER_OPTION_TABLE.'.option_field_id'
)
)
->group_by(MP_NEWSLETTERS_TABLE.'.id'); ->group_by(MP_NEWSLETTERS_TABLE.'.id');
return $orm; return $orm;
} }

View File

@ -322,12 +322,20 @@ class Subscriber extends Model {
$orm = $orm $orm = $orm
->leftOuterJoin( ->leftOuterJoin(
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE, MP_SUBSCRIBER_CUSTOM_FIELD_TABLE,
array(MP_SUBSCRIBERS_TABLE.'.id', '=', array(
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.subscriber_id')) MP_SUBSCRIBERS_TABLE.'.id',
'=',
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.subscriber_id'
)
)
->leftOuterJoin( ->leftOuterJoin(
MP_CUSTOM_FIELDS_TABLE, MP_CUSTOM_FIELDS_TABLE,
array(MP_CUSTOM_FIELDS_TABLE.'.id','=', array(
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.custom_field_id')) MP_CUSTOM_FIELDS_TABLE.'.id',
'=',
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.custom_field_id'
)
)
->groupBy(MP_SUBSCRIBERS_TABLE.'.id'); ->groupBy(MP_SUBSCRIBERS_TABLE.'.id');
return $orm; return $orm;
} }
@ -345,12 +353,18 @@ class Subscriber extends Model {
$orm = $orm $orm = $orm
->leftOuterJoin( ->leftOuterJoin(
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE, MP_SUBSCRIBER_CUSTOM_FIELD_TABLE,
array(MP_SUBSCRIBERS_TABLE.'.id', '=', array(
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.subscriber_id')) MP_SUBSCRIBERS_TABLE.'.id', '=',
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.subscriber_id'
)
)
->leftOuterJoin( ->leftOuterJoin(
MP_CUSTOM_FIELDS_TABLE, MP_CUSTOM_FIELDS_TABLE,
array(MP_CUSTOM_FIELDS_TABLE.'.id','=', array(
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.custom_field_id')); MP_CUSTOM_FIELDS_TABLE.'.id','=',
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.custom_field_id'
)
);
return $orm; return $orm;
} }
@ -532,7 +546,8 @@ class Subscriber extends Model {
SubscriberSegment::subscribeManyToSegments( SubscriberSegment::subscribeManyToSegments(
$subscriber_ids, array($segment->id) $subscriber_ids, array($segment->id)
); );
}); }
);
return array( return array(
'subscribers' => $subscribers_count, 'subscribers' => $subscribers_count,
@ -653,8 +668,9 @@ class Subscriber extends Model {
str_repeat( str_repeat(
'(' . rtrim(str_repeat('?,', count($columns)), ',') . ')' . ', ' '(' . rtrim(str_repeat('?,', count($columns)), ',') . ')' . ', '
, count($values) , count($values)
) ),
, ', '), ', '
),
Helpers::flattenArray($values) Helpers::flattenArray($values)
); );
} }

View File

@ -179,23 +179,25 @@ class Export {
function getSubscribers($offset, $limit) { function getSubscribers($offset, $limit) {
// JOIN subscribers on segment and subscriber_segment tables // JOIN subscribers on segment and subscriber_segment tables
$subscribers = Subscriber:: $subscribers = Subscriber::left_outer_join(
left_outer_join(
SubscriberSegment::$_table, SubscriberSegment::$_table,
array( array(
Subscriber::$_table . '.id', Subscriber::$_table . '.id',
'=', '=',
SubscriberSegment::$_table . '.subscriber_id' SubscriberSegment::$_table . '.subscriber_id'
)) )
)
->left_outer_join( ->left_outer_join(
Segment::$_table, Segment::$_table,
array( array(
Segment::$_table . '.id', Segment::$_table . '.id',
'=', '=',
SubscriberSegment::$_table . '.segment_id' SubscriberSegment::$_table . '.segment_id'
)) )
)
->filter('filterWithCustomFieldsForExport') ->filter('filterWithCustomFieldsForExport')
->groupBy(Subscriber::$_table . '.id'); ->groupBy(Subscriber::$_table . '.id');
if($this->subscribers_without_segment !== false) { if($this->subscribers_without_segment !== false) {
// if there are subscribers who do not belong to any segment, use // if there are subscribers who do not belong to any segment, use
// a CASE function to group them under "Not In Segment" // a CASE function to group them under "Not In Segment"

View File

@ -293,8 +293,7 @@ class Import {
); );
} }
} }
$query = Subscriber::selectMany( $query = Subscriber::selectMany(array(
array(
'id', 'id',
'email' 'email'
)); ));