Subversion Repositories SmartDukaan

Rev

Rev 15607 | Rev 15667 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15607 Rev 15621
Line 122... Line 122...
122
		$this->set('agentActivations',$agentActivations);
122
		$this->set('agentActivations',$agentActivations);
123
		$this->set(compact('activations','date'));
123
		$this->set(compact('activations','date'));
124
	}
124
	}
125
 
125
 
126
	public function admin_brandpreferences_report() {
126
	public function admin_brandpreferences_report() {
127
		$sql = "SELECT DATE( created ) date, brand, COUNT( id ) count FROM  `brand_preferences` WHERE STATUS =  'show' AND DATEDIFF( NOW( ) , created ) <= 7 GROUP BY  `brand_preferences`.`brand` , DATE( created ) ORDER BY DATE( created ) DESC,count desc";
-
 
128
		$this->loadModel('BrandPreference');
127
		$this->loadModel('BrandPreference');
-
 
128
		$sql = "SELECT DATE( created ) date, brand, COUNT( id ) count FROM  `brand_preferences` WHERE STATUS =  'show' AND DATEDIFF( NOW( ) , created ) <= 7 GROUP BY  `brand_preferences`.`brand` , DATE( created ) ORDER BY DATE( created ) DESC,count desc";
129
		$brand_preferences = $this->BrandPreference->query($sql);
129
		$brand_preferences = $this->BrandPreference->query($sql);
-
 
130
		$sql = "SELECT brand, COUNT( id ) count FROM  `brand_preferences` WHERE STATUS =  'show' AND DATEDIFF( NOW( ) , created ) <= 7 GROUP BY  `brand_preferences`.`brand` ORDER BY count desc";
-
 
131
		$count = $this->BrandPreference->query($sql);
130
		$this->set(compact('brand_preferences'));
132
		$this->set(compact('brand_preferences','count'));
131
	}
133
	}
132
 
134
 
133
	public function admin_brandfilters_report() {
135
	public function admin_brandfilters_report() {		
134
		$sql = "select date(created) date,group_concat(filters separator '|') brands from user_filters where type = 'brand' group by date(created)";
136
		set_time_limit(180);
135
		$this->loadModel('UserFilter');
137
		$this->loadModel('UserFilter');		
-
 
138
		$sql = "select date(created) date,group_concat(filters separator '|') brands from user_filters where type = 'brand' group by date(created) ORDER BY id DESC";
136
		$brand_filters = $this->UserFilter->query($sql);
139
		$brand_filters = $this->UserFilter->query($sql);
137
		$this->set(compact('brand_filters'));
140
		$this->set(compact('brand_filters','all'));
138
	}
141
	}
139
}
142
}
140
143