Skip to content

Instantly share code, notes, and snippets.

View Current Attempt
SELECT del.* FROM del AS a
JOIN accts ON a.acctno = accts.acctno AND accts.status IN ('1', '2')
JOIN trans ON a.acctno = trans.acctno AND trans.code NOT IN ('1', '2')
AND ( SELECT MAX(trans.dte) FROM trans AS b WHERE b.acctno = a.acctno ORDER BY b.dte DESC ) < {date}
WHERE a.days > 90
View gist:0e4d0845c28c74ca99f2
// Model User.php
public function groups()
{
return $this->belongsToMany('SARP\UserGroup','users_groups', 'user_id', 'group_id');
}
// Model UserGroup.php
public function users()
{
View array.php
<?php
$social_data = [
[
'first' => 'John',
'middle' => 'Smith',
'last' => 'Doe',
'email' => 'abc@example.com'
],
[