Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $query = "DROP TABLE if exists TempDatesTable;";
- $query .= "CREATE TEMPORARY TABLE TempDatesTable ( days char(20) ) TYPE=HEAP DEFAULT CHARSET=utf8;";
- foreach ($allDatesInsideInterval as $date) {
- $query .= "INSERT INTO TempDatesTable VALUES( '$date' );";
- }
- Yii::app()->db->createCommand($query)->execute();
- $command = Yii::app()->db->createCommand()
- ->select('allDays.days as periodDay, numberOfSentRequests, numberOfReceivedRequests, numOfLogins, numOfProfilesViewed')
- ->from("(" . $commandDates->getText() . ") allDays")
- ->leftJoin("(" . $commandProfileViewed->getText() . ") accessLog", 'allDays.days = accessLog.days')....
- return new CSqlDataProvider($command->getText(), array(
- 'totalItemCount' => count($allDatesInsideInterval),
- 'pagination' => array(
- 'pageSize' => self::PAGE_SIZE
- ),
- ...
- $command = false;
- $query = "DROP TABLE if exists TempDatesTable;";
- $query .= "CREATE TEMPORARY TABLE TempDatesTable ( days char(20) ) TYPE=HEAP DEFAULT CHARSET=utf8";
- foreach ($allDatesInsideInterval as $date) {
- $query .= "; INSERT INTO TempDatesTable VALUES( '$date' )";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement