This file contains hidden or 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
{ | |
"id": 79, | |
"name": "V Day offer", | |
"business": { | |
"id": 22, | |
"name": "Restaurant Group 1", | |
"category": { | |
"id": 19, | |
"name": "Food & Wine", | |
"image": "http://res.cloudinary.com/getpickledeals/image/upload/c_fill,h_200,w_400/v1452803662/fooddining_culsby.jpg", |
This file contains hidden or 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
use sellerdata; | |
1. select count(*) from sellers; | |
2. select count(*) from seller_histories where signed_in_at is not null; | |
3. select count(s.user_id) from treasureProduct.products p INNER JOIN seller_histories s ON s.user_id = p.user_id where s.signed_in_at is not null group by p.user_id having count(p.id) > 0; | |
4. select count(*) from sellers where app_installed = 1; |
This file contains hidden or 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
function initializeAutocomplete(){ | |
var input = document.getElementById('product_f_locality'); | |
var options = { | |
types: ['(regions)'], | |
componentRestrictions: {country: "IN"} | |
}; | |
var autocomplete = new google.maps.places.Autocomplete(input, options); | |
google.maps.event.addListener(autocomplete, 'place_changed', function() { |
This file contains hidden or 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
SELECT DISTINCT COUNT(DISTINCT `products`.`id`) | |
FROM `products` | |
WHERE (moderation_status in ('QUEUED','QUEUED_AFTER_APPROVAL','QUEUED_AFTER_REJECT','PROMOTED') | |
OR treasureProduct.products.id in (NULL)) | |
/*=====================*/ | |
SELECT COUNT(DISTINCT u.id) AS Listers,COUNT(p.id)AS Listings | |
FROM accounts.users u | |
LEFT JOIN |
This file contains hidden or 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
{ | |
"response": [{ | |
"name": "Food", | |
"description": "This is food", | |
"image": "http://asdf.com", | |
"keywords": "eat, pray, love", | |
"subcategories": [{ | |
"name": "burger", | |
"description": "this is nonveg", | |
"image": "http://io.io", |
This file contains hidden or 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
def process_available_days(p) | |
[0,1,0,1,0,1,0] | |
end | |
def prepare_params(p) | |
p[:available_days] = process_available_days(p[:available_days]) | |
p.except(:branches_deals) | |
end | |
def create |
This file contains hidden or 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
SELECT a.id, u.name, a.last_received_date, u.mobile_number,MAX(c.created_at) AS last_replied_date, COUNT(DISTINCT p.id) AS p_count, unique_buyers | |
FROM shopo_chats.chats c RIGHT JOIN | |
(SELECT | |
to_user AS id, | |
MAX(created_at) AS last_received_date, | |
COUNT(distinct(actor_id)) AS unique_buyers | |
FROM shopo_chats.chats | |
WHERE | |
to_user=target_id | |
AND |
This file contains hidden or 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
private UpdateImageDTO generateOtherImages(UpdateImageDTO imgDto) { | |
try { | |
String thumb = "c_fit,w_72"; | |
String medium = "c_fit,w_560"; | |
String delimiter = "(?<=/upload/)|(?<=/fetch/)"; | |
String originalImageUrl = imgDto.getOriginal(); | |
String[] subStrings = originalImageUrl.split(delimiter,2); |
This file contains hidden or 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
SELECT a.id, u.name, a.last_received_date, u.mobile_number, MAX(c.created_at) AS last_replied_date, p.products_count AS p_count, unique_buyers | |
FROM shopo_chats.chats c RIGHT JOIN | |
(SELECT | |
to_user AS id, | |
MAX(created_at) AS last_received_date, | |
COUNT(distinct(buyer_id)) AS unique_buyers | |
FROM shopo_chats.chats | |
WHERE | |
to_user=seller_id | |
AND |
This file contains hidden or 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
================ TUESDAY ================ | |
1. Inserted the avg,min,max from main JobBank table into job_bank_temp | |
2. added occupation_id into regions_salaries | |
3. added name_br to occupations table | |
4. ALTER TABLE occupations DROP COLUMN programme_id; | |
================ TUESDAY ================ |