order分析
@access protected
@param mixed $order
@return array
343228
protected function parseOrder($order) {
        if(is_string($order)) {
            $array   =  explode(',',$order);
            $order   =  array();
            foreach ($array as $key=>$val){
                $arr  =  explode(' ',trim($val));
                if(isset($arr[1])) {
                    $arr[1]  =  $arr[1]=='asc'?1:-1;
                }else{
                    $arr[1]  =  1;
                }
                $order[$arr[0]]    = $arr[1];
            }
        }
        return $order;
    }
706349
public function order($order = null) {
		if ($order) {
			$this->_config['order'] = $order;
			return $this;
		}
		return $this->_config['order'];
	}
1212865
public function transform(Order $order)
    {
        foreach ($order->meta() as $key => $total) {
            $payload[$key] = $this->converter->convert($total);
        }

        $payload['products'] = [];

        foreach ($order->products() as $product) {
            $payload['products'][] = array_map(function ($value) {
                return $this->converter->convert($value);
            }, $product);
        }

        return json_encode($payload);
    }
495384
public function sortable($order = null)
    {
        if (null === $order) {
            return $this->sortable;
        }

        $this->sortable = $order;
        return $this;
    }
333162
public function actionAll($sort = '')
    {
        $order = ExtHelpers::getOrder($sort, [
            'group_id',
            'name',
            'is_system',
            'note',
            'status'
        ], [], 'group_id DESC');
        $list = DpAdminGroup::getAll($order);

        return [
            'total' => count($list),
            'list' => $list,
        ];
    }
412749
public function groupBy(string $column, string $order = null): self
    {
        $this->groupBy[] = [
            'column' => $column,
            'order'  => $order,
        ];

        return $this;
    }
432655
public function all($order = 'ASC')
    {
        $capsule = $this->_database->getCapsule();

        $this->_model = $capsule->table($this->table)->orderBy('id', $order)->get();

        return $this->_model;
    }
926436
protected function normalizeOrder($order)
    {
        switch (strtolower($order)) {
            case 'asc':
                return 'asc';
            case 'desc':
                return 'desc';
            default:
                throw new QueryException(sprintf('Unsupported sorting method "%s" in query "%s"', $this->getType($order), $this->model->entity()));

        }
    }
240232
protected function sortFiles($order)
    {
        $order = explode(',', $order);

        $new = [];
        $original = $this->original();

        foreach ($order as $item) {
            $new[] = Arr::get($original, $item);
        }

        return $new;
    }
657346
public function setOrder($order)
    {
        if (!empty($order)) {
            $this->query['order'] = $order;
        } else {
            unset($this->query['order']);
        }
        return $this;
    }
1285220
protected function getTotalQtyItemsOrdered($order) {
        $qty = 0;
        $orderedItems = $order->getItemsCollection();
        foreach ($orderedItems as $item)
        {
            if (!$item->isDummy()) {
                $qty += (int)$item->getQtyOrdered();
            }
        }
        return $qty;
    }
657932
public function createOrder($order = array())
    {
        $myOrder = new Order($order);
        $response = OrderService::createOrder($myOrder);

        if (isset($response["orderCode"])) {
            //success
            return $response;
        } else {
            Error::throwError("apierror");
        }
    }
385165
public function fetchAll($order=array()) {
		$obj = $this->getConnection();
        if (empty($order) == false) {
            foreach ($order as $key => $value) {
                $obj->orderBy($key, $value);
            }
        }
        return $obj->get($this->getDao()->getTableName());
	}
712784
private function formatArray($order, $item, $remove = false, $lastItem = true)
    {
        return [
            'remove'   => $remove,
            'lastItem' => $lastItem,
            'item'     => [
                'quantity' => $item->getQuantity(),
                'total'    => $this->moneyFormatter->format(
                    $item->getTotal(),
                    $order->getCurrencyCode(),
                    $order->getLocaleCode()
                ),
                'subtotal' => $this->moneyFormatter->format(
                    $item->getSubTotal(),
                    $order->getCurrencyCode(),
                    $order->getLocaleCode()
                ),
            ],
            'order' => [
                'total' => $this->moneyFormatter->format(
                    $order->getTotal(),
                    $order->getCurrencyCode(),
                    $order->getLocaleCode()
                ),
                'items-total' => $this->moneyFormatter->format(
                    $order->getItemsTotal(),
                    $order->getCurrencyCode(),
                    $order->getLocaleCode()
                ),
            ],
            'payments' => $this->getPaymentsTotals($order),
        ];
    }
524292
protected function sort($order)
    {
        $ordered = [];

        $matrix = [
            'label'     => 'getLabels',
            'component' => 'getComponents',
            'message'   => 'getMessage',
        ];

        foreach ($order as $identifier) {
            $components = $this->{$matrix[$identifier]}();
            foreach ($components as $component) {
                $index                              = count($ordered);
                $this->indexReverse[$identifier][0] = $index;
                $this->index[$index]                = $identifier;
                $ordered[]                          = $component;
            }
        }

        return $ordered;
    }
258089
protected function getOrderCondition( $orders = array() ){
		$order	= '';
		if( is_array( $orders ) && count( $orders ) )
		{
			$list	= array();
			foreach( $orders as $column => $direction )
				$list[] = '`'.$column.'` '.strtoupper( $direction );
			$order	= ' ORDER BY '.implode( ', ', $list );
		}
		return $order;
	}
903651
function order($order)
    {
        if (!empty($order))
        {
            self::sql_safe($order);
            $this->order = "order by $order";
        }
        else
        {
            $this->order = '';
        }
    }