<?php

# 需求订单类

namespace Demand\Lib;

use Dever;
use Main\Lib\Core;

class Order extends Core
{
	protected $checkUser = true;

	# 获取我的订单
	public function my()
	{
		$where['uid'] = $this->data['uid'];
		$data = Dever::db('demand/order')->state($where);

		if ($data) {
			$demand = Demand::init(-1);
			foreach ($data as $k => $v) {
				$data[$k]['demand'] = $demand->getInfo($v['product_id'], true, 'list_reorder');
			}
		}

		return $data;
	}
}