SELECT
q.id,
q.ref,
q.job_desc,
q.roof_size,
q.roof_height,
q.job_type,
(SELECT status
FROM tracker_quote_status
WHERE id = q.quote_status) AS job_status,
CONCAT(c.fname, ' ', c.sname) AS customer_name,
TRIM(REGEXP_REPLACE(
CASE
WHEN q.existing = 0 THEN
CONCAT_WS(' ', c.street, c.street2, c.town, c.county)
ELSE
CONCAT_WS(' ', q.street, q.street2, q.town, q.county)
END,
'^[0-9]+\s*',
''
)) AS address,
CASE
WHEN q.existing = 0 THEN c.town
ELSE q.town
END AS service_place,
CASE
WHEN q.existing = 0 THEN
(SELECT region FROM places_uk WHERE place = c.town LIMIT 1)
ELSE
(SELECT region FROM places_uk WHERE place = q.town LIMIT 1)
END AS region,
CASE
WHEN JSON_CONTAINS(q.rooferID, '417') THEN 'Mayowa Olaleye Surveyor'
WHEN JSON_CONTAINS(q.rooferID, '428') THEN 'DSI Services (Reports)'
ELSE ''
END AS user
FROM tracker_quotes q
INNER JOIN tracker_customers c
ON q.customerID = c.id
WHERE
(
JSON_CONTAINS(q.rooferID, '417')
OR JSON_CONTAINS(q.rooferID, '428')
)
AND q.deleted_at IS NULL
AND q.job_type IN (13,36)
AND q.quote_status=4 HAVING region='Greater Manchester' ORDER BY q.id DESCArray
(
[keyword] => pre-purchase-roof-inspections
[location] => Sharston - Greater Manchester
[region] => Greater-Manchester
)
Array
(
[0] => Array
(
[id] => 4138
[ref] => TA27QB-LAN-4138
[job_desc] => Drone Roof Inspections and Surveys
[roof_size] => 3 bedrooms
[roof_height] => 2 storeys
[job_type] => 13
[job_status] => Completed
[customer_name] => Callum Langley
[address] => Lansdowne Rd, Taunton
[service_place] => Taunton
[region] => Greater Manchester
[user] => DSI Services (Reports)
)
[1] => Array
(
[id] => 3893
[ref] => M298NQ-LYN-3893
[job_desc] => Drone Roof Inspections and Surveys
[roof_size] => 3 bedrooms
[roof_height] => 2 storeys
[job_type] => 13
[job_status] => Completed
[customer_name] => Anthony Lynch
[address] => Sale Ln, Tyldesley, Manchester
[service_place] => Manchester
[region] => Greater Manchester
[user] => DSI Services (Reports)
)
[2] => Array
(
[id] => 3832
[ref] => M146SY-BUT-3832
[job_desc] => Drone Roof Inspections and Surveys
[roof_size] => 2 bedrooms
[roof_height] => 2 storeys
[job_type] => 13
[job_status] => Completed
[customer_name] => Lucy Butterworth
[address] => Park View Ladybarn Manchester
[service_place] => Manchester
[region] => Greater Manchester
[user] => DSI Services (Reports)
)
[3] => Array
(
[id] => 3749
[ref] => TA11DE-CUL-3749
[job_desc] => Drone Roof Inspections and Surveys
[roof_size] => Medium Commercial
[roof_height] => 3 storeys
[job_type] => 13
[job_status] => Completed
[customer_name] => Malcolm J Cullen
[address] => Bupa Dental, Yarde House1 Staplegrove Road, Taunton
[service_place] => Taunton
[region] => Greater Manchester
[user] => Mayowa Olaleye Surveyor
)
[4] => Array
(
[id] => 3664
[ref] => M403AG-ODO-3664
[job_desc] => Drone Roof Inspections and Surveys
[roof_size] => Medium Commercial
[roof_height] => 2 storeys
[job_type] => 13
[job_status] => Completed
[customer_name] => Michael ODonovan
[address] => LGMO Properties Reliance St, Manchester
[service_place] => Manchester
[region] => Greater Manchester
[user] => Mayowa Olaleye Surveyor
)
[5] => Array
(
[id] => 3415
[ref] => M251JF-YOU-3415
[job_desc] => Drone Roof Inspections and Surveys
[roof_size] => 2 bedrooms
[roof_height] => 2 storeys
[job_type] => 13
[job_status] => Completed
[customer_name] => Robert Younge
[address] => Bury Old Road Prestwich, Manchester
[service_place] => Manchester
[region] => Greater Manchester
[user] => DSI Services (Reports)
)
[6] => Array
(
[id] => 3413
[ref] => M389WH-ZAI-3413
[job_desc] => Drone Roof Inspections and Surveys
[roof_size] => Flats
[roof_height] => 2 storeys
[job_type] => 13
[job_status] => Completed
[customer_name] => Asad Zaidi
[address] => Manchester Rd E, Little Hulton, Manchester
[service_place] => Manchester
[region] => Greater Manchester
[user] => Mayowa Olaleye Surveyor
)
[7] => Array
(
[id] => 3340
[ref] => TA43DA-FEA-3340
[job_desc] => Drone Roof Inspections and Surveys
[roof_size] => 3 bedrooms
[roof_height] => 2 storeys
[job_type] => 13
[job_status] => Completed
[customer_name] => Imogen Featherstone
[address] => Greenway, Bishops Lydeard, Taunton
[service_place] => Taunton
[region] => Greater Manchester
[user] => Mayowa Olaleye Surveyor
)
[8] => Array
(
[id] => 3281
[ref] => WA159HX-ORI-3281
[job_desc] => Drone Roof Inspections and Surveys
[roof_size] => 3 bedrooms
[roof_height] => 2 storeys
[job_type] => 13
[job_status] => Completed
[customer_name] => Rusef Oriley
[address] => Beech Rd Hale Altrincham
[service_place] => Altrincham
[region] => Greater Manchester
[user] => Mayowa Olaleye Surveyor
)
[9] => Array
(
[id] => 2946
[ref] => TA44QU-CHU-2946
[job_desc] => Drone Roof Inspections and Surveys
[roof_size] => 1 bedroom
[roof_height] => 2 storeys
[job_type] => 13
[job_status] => Completed
[customer_name] => Daniel Church
[address] => Long St Williton, Taunton
[service_place] => Taunton
[region] => Greater Manchester
[user] => DSI Services (Reports)
)
[10] => Array
(
[id] => 2561
[ref] => TA15LS-EVE-2561
[job_desc] => Drone Roof Inspections and Surveys
[roof_size] => 3 bedrooms
[roof_height] => 2 storeys
[job_type] => 13
[job_status] => Completed
[customer_name] => Gordon Everett
[address] => Mountway Rd, Bishop's Hull, Taunton
[service_place] => Taunton
[region] => Greater Manchester
[user] => DSI Services (Reports)
)
[11] => Array
(
[id] => 2528
[ref] => TA43DA-FEA-2528
[job_desc] => Drone Roof Inspections and Surveys
[roof_size] => 3 bedrooms
[roof_height] => 2 storeys
[job_type] => 13
[job_status] => Completed
[customer_name] => Imogen Featherstone
[address] => Greenway, Bishops Lydeard, Taunton
[service_place] => Taunton
[region] => Greater Manchester
[user] => Mayowa Olaleye Surveyor
)
[12] => Array
(
[id] => 2481
[ref] => M252WL-FIN-2481
[job_desc] => Drone Roof Inspections and Surveys
[roof_size] => 3 bedrooms
[roof_height] => 2 storeys
[job_type] => 13
[job_status] => Completed
[customer_name] => Matthew Findlay
[address] => Polefield Grange, Prestwich, Manchester
[service_place] => Manchester
[region] => Greater Manchester
[user] => DSI Services (Reports)
)
[13] => Array
(
[id] => 2382
[ref] => M283WJ-COS-2382
[job_desc] => Drone Roof Inspections and Surveys
[roof_size] => 3 bedrooms
[roof_height] => 2 storeys
[job_type] => 13
[job_status] => Completed
[customer_name] => Mathew Cosgrove
[address] => Manchester Road Manchester
[service_place] => Manchester
[region] => Greater Manchester
[user] => DSI Services (Reports)
)
[14] => Array
(
[id] => 2196
[ref] => M408NS-PRA-2196
[job_desc] => Drone Roof Inspections and Surveys
[roof_size] => 3 bedrooms
[roof_height] => 2 storeys
[job_type] => 13
[job_status] => Completed
[customer_name] => Chandra Prajapati
[address] => Lathbury Road Manchester
[service_place] => Manchester
[region] => Greater Manchester
[user] => Mayowa Olaleye Surveyor
)
[15] => Array
(
[id] => 2078
[ref] => M359GX-OKP-2078
[job_desc] => Drone Roof Inspections and Surveys
[roof_size] => 4 bedrooms
[roof_height] => 2 storeys
[job_type] => 13
[job_status] => Completed
[customer_name] => Ugochi Okpala
[address] => Alexander Ave Oldham
[service_place] => Oldham
[region] => Greater Manchester
[user] => Mayowa Olaleye Surveyor
)
[16] => Array
(
[id] => 2074
[ref] => M460PA-NEI-2074
[job_desc] => Drone Roof Inspections and Surveys
[roof_size] => 2 bedrooms
[roof_height] => 2 storeys
[job_type] => 13
[job_status] => Completed
[customer_name] => Chris Neil
[address] => Leigh Rd Atherton Manchester
[service_place] => Manchester
[region] => Greater Manchester
[user] => DSI Services (Reports)
)
)
Greater-Manchester - Sharston - Greater Manchester
3 bedrooms/2 storeys - Lansdowne Rd, Taunton
Inspection: Pre-Purchase Roof Inspections
Greater-Manchester - Sharston - Greater Manchester
3 bedrooms/2 storeys - Sale Ln, Tyldesley, Manchester
Inspection: Pre-Purchase Roof Inspections
Greater-Manchester - Sharston - Greater Manchester
2 bedrooms/2 storeys - Park View Ladybarn Manchester
Inspection: Pre-Purchase Roof Inspections