Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*miniShop2 заказы*/
- $date=date("Y-m-d",time()-(3600*24*31*2));
- $pdo = $this->modx->getService('pdoFetch');
- $q = $this->modx->newQuery('msOrder');
- $q->where(array(
- 'createdon:>' => $date
- ));
- $orders = $this->modx->getIterator('msOrder',$q);
- foreach($orders as $msOrder){
- $order = $msOrder->toArray();
- $order['address'] = $pdo->getArray('msOrderAddress', array('id' => $order['address']), array('sortby' => 'id'));
- $order['delivery'] = $pdo->getArray('msDelivery', array('id' => $order['delivery']), array('sortby' => 'id'));
- $order['payment'] = $pdo->getArray('msPayment', array('id' => $order['payment']), array('sortby' => 'id'));
- $order['profile'] = $pdo->getArray('modUserProfile', array('internalKey' => $order['user_id']), array('sortby' => 'id'));
- $order['products'] = $pdo->getCollection('msOrderProduct', array('order_id' => $order['id']), array('sortby' => 'id'));
- print_r($order);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement