New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$rs in getTransactions in module.php not init line3004 #379

Open
JesseXie opened this Issue Dec 20, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@JesseXie
Copy link

JesseXie commented Dec 20, 2018

function getTransactions($siteId, $startDate, $endDate, $period, $sort = 'desc', $resultsPerPage = 25, $page = 1, $format = 'json') {
	
	$db = owa_coreAPI::dbSingleton();
	$db->selectFrom('owa_commerce_transaction_fact');
	$db->selectColumn("*");
	$db->orderBy('timestamp', $sort);
	$db->where('site_id', $siteId);
	if ( $period ) {
		
		$p = owa_coreAPI::supportClassFactory('base', 'timePeriod');
		$p->set($period);
		$startDate = $p->startDate->get('yyyymmdd');
		$endDate = $p->endDate->get('yyyymmdd');
	}
	
	if ($startDate && $endDate) {
		$db->where('yyyymmdd', array('start' => $startDate, 'end' => $endDate), 'BETWEEN');
	}
	
	// pass limit to rs object if one exists
	$rs->setLimit($resultsPerPage);
		
	// pass page to rs object if one exists
	$rs->setPage($page);
	
	$results = $rs->generate($db);
	//$rs->resultsRows = $results;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment