Subversion Repositories SmartDukaan

Rev

Rev 14346 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 14346 Rev 17392
Line 2... Line 2...
2
class OrderpushShell extends AppShell {
2
class OrderpushShell extends AppShell {
3
    public $uses = array('PythonApi','Order');
3
    public $uses = array('PythonApi','Order');
4
 
4
 
5
    public function main() {
5
    public function main() {
6
	Configure::load('live');
6
	Configure::load('live');
7
	$options = array('conditions'=>array('status'=>'ORDER_NOT_CREATED'),'recursive'=>-1);
7
	$options = array('conditions'=>array('status'=>array('ORDER_NOT_CREATED', 'new')),'recursive'=>-1);
8
	$orders = $this->Order->find('all',$options);
8
	$orders = $this->Order->find('all',$options);
9
	if(!empty($orders)) {
9
	if(!empty($orders)) {
10
		foreach($orders AS $order) {
10
		foreach($orders AS $order) {
11
			$response = $this->PythonApi->postOrders($order);
11
			$response = $this->PythonApi->postOrders($order);
12
			if(!empty($response) && $response['result']) {
12
			if(!empty($response) && $response['result']) {