Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "SELECT count(requests.id) as getAllOrder, count(IF(date <= "2019-05-29" AND date >= "2019-05-22", 1, NULL)) as nowOrder, count(IF(date <= "2019-05-29" AND date >= "2019-05-22" AND status = "1" AND dop_status = "1", 1, NULL)) as getAllOrderApryv, ((count(IF(date <= "2019-05-29" AND date >= "2019-05-22" AND status = "1", 1, NULL))/count(IF(date <= "2019-05-29" AND date >= "2019-05-22", 1, NULL)))*100) as getAllOrderApprove, count(IF(date <= "2019-05-22" AND date >= "2019-05-15" AND status = "1" AND dop_status = "1", 1, NULL)) as getAllOrderApryvOld, ((count(IF(date <= "2019-05-29" AND date >= "2019-05-22" AND status = "1", 1, NULL))/count(IF(date <= "2019-05-22" AND date >= "2019-05-15" AND status = "1", 1, NULL)))*100) as getAllOrderApproveOld, count(IF(date <= "2019-05-22" AND date >= "2019-05-15", 1, NULL)) as getAllOrderOld, SUM(IF(goals.advertiser_id != 9 AND date <= "2019-05-29" AND date >= "2019-05-22", real_profit, 0)) as getProfit, SUM(IF(goals.advertiser_id != 9 AND date <= "2019-05-22" AND date >= "2019-05-15", real_profit, 0)) as getOldProfit, SUM(IF(goals.advertiser_id != 9, real_profit, 0)) as getAllProfit
- FROM (`requests`)
- LEFT JOIN `goals` ON `goals`.`id`=`requests`.`goal_id`
- WHERE `date` >= '2019-05-15'
- AND `date` <= '2019-05-29'"
Advertisement
Add Comment
Please, Sign In to add comment