按路径查询，得到列表
@param $kpath
@param $order
@return $list
434023
function pgets($kpath,$order='')
	{
		$gets['kpath'] = $kpath;
		$gets['order'] = $order;
		return $this->gets($gets);
	}
399696
public ArrayList<Long> order_GET(Date date_from, Date date_to) throws IOException {
		String qPath = "/me/order";
		StringBuilder sb = path(qPath);
		query(sb, "date.from", date_from);
		query(sb, "date.to", date_to);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t2);
	}
1042846
public function orderBy($order = null) {
		if (is_null($order)) //remove option
			return $this->discard('query.orderBy');
			
		return $this->merge(['query.orderBy' => func_get_args()]);
	}
243724
protected function getSortDirections($order)
	{
		$segs=explode(',',$order);
		$directions=array();
		foreach($segs as $seg)
		{
			if(preg_match('/(.*?)(\s+(desc|asc))?$/i',trim($seg),$matches))
				$directions[$matches[1]]=isset($matches[3]) && !strcasecmp($matches[3],'desc');
			else
				$directions[trim($seg)]=false;
		}
		return $directions;
	}
544300
public function findOrderCouponsByOrder(OrderInterface $order)
    {
        return $this
            ->createQueryBuilder('oc')
            ->where('oc.order = :order')
            ->setParameter('order', $order)
            ->getQuery()
            ->getResult();
    }
1182713
public function getTotalHubFeeForOrder(\HarvestCloud\CoreBundle\Entity\Order $order)
    {
        return ($order->getLineItemTotal() * $this->getSellerHubRef()->getVariableFee() / 100) + $this->getSellerHubRef()->getFixedFee();
    }
440859
public function createApiLogsByOrderIds($orders)
    {
        $ids = [];
        /** @var \Orm\Zed\Sales\Persistence\SpySalesOrder $order */
        foreach ($orders as $order) {
            $ids[] = $order->getIdSalesOrder();
        }

        $query = $this->getFactory()->createPaymentPayoneApiLogQuery()
            ->useSpyPaymentPayoneQuery()
            ->filterByFkSalesOrder($ids, Criteria::IN)
            ->endUse()
            ->orderByCreatedAt();

        return $query;
    }
831246
public function prepareOrder($order = null, $sort = null)
    {
        if ($order == null or $sort == null) {
            $this->setOrderBy = '';

            return $this;
        }

        if (!in_array($sort, ['ASC', 'DESC'])) {
            $sort = 'DESC';
        }

        $this->setOrderBy = ' ORDER BY ' . $order . ' ' . $sort;

        return $this;
    }
1014313
public function findCouponsByOrder(OrderInterface $order)
    {
        $orderCoupons = $this
            ->createQueryBuilder('oc')
            ->where('oc.order = :order')
            ->setParameter('order', $order)
            ->getQuery()
            ->getResult();

        return array_map(function (OrderCouponInterface $orderCoupon) {
            return $orderCoupon->getCoupon();
        }, $orderCoupons);
    }
1269071
public function query(array $order)
    {
        Datasheet::set($order);
        $result = Helper::request(Helper::GATEWAY_TRADEQUERY, ['AuthCode']);
        return $this->callback($result);
    }
679172
public function query(array $order)
    {
        Datasheet::set($order);
        $param_keys = ['appid', 'mch_id', 'out_trade_no', 'transaction_id', 'nonce_str'];
        return Helper::request(Helper::GATEWAY_ORDERQUERY, $param_keys);
    }
155403
public function orderItems(Order $order)
    {
        return response()->json([
            'errors' => false,
            'data' => $order->items->map(function($item) {
                $item->product->load('options');
                return $item;
            }),
        ]);
    }
536286
public static function orderArray($array, $order)
    {
        $ordered = [];

        foreach ($order as $key) {
            if (array_key_exists($key, $array)) {
                $ordered[$key] = $array[$key];
            }
        }

        return $ordered;
    }
1197916
protected function checkOrder($order='') {
         if(is_string($order) && !empty($order)) {
            $orders = explode(',',$order);
            $_order = array();
            foreach ($orders as $order){
                $array = explode(' ',trim($order));
                $field   =   $array[0];
                $sort   =   isset($array[1])?$array[1]:'ASC';
                // 解析成视图字段
                foreach ($this->viewFields as $name=>$val){
                    $k = isset($val['_as'])?$val['_as']:$name;
                    $val  =  $this->_checkFields($name,$val);
                    if(false !== $_field = array_search($field,$val,true)) {
                        // 存在视图字段
                        $field     =  is_numeric($_field)?$k.'.'.$field:$k.'.'.$_field;
                        break;
                    }
                }
                $_order[] = $field.' '.$sort;
            }
            $order = implode(',',$_order);
         }
        return $order;
    }
1282819
public function sortPrimaryKeys(array $order = null)
    {
        if (!$order) {
            ksort($this->values);

            return;
        }

        $orderedKeys = array_intersect_key(array_flip($order), $this->values);

        $this->values = array_replace($orderedKeys, $this->values);
    }
1046076
public List<Order> create(OrderBy order) {
        List<Order> list = new ArrayList<>();

        for (SortSpecification sort : order.getSort()) {
            if (sort.getSortOrder() == SortOrder.DESC) {
                list.add(cb.desc(root.get(sort.getKey())));
            } else if (sort.getSortOrder() == SortOrder.ASC) {
                list.add(cb.asc(root.get(sort.getKey())));
            }
        }

        return list;
    }
943770
protected function recode_choice_order($order) {
        $neworder = array();
        foreach (explode(',', $order) as $id) {
            if ($newid = $this->get_mappingid('question_answer', $id)) {
                $neworder[] = $newid;
            }
        }
        return implode(',', $neworder);
    }