<?php

/**
 *--------------------------------------
 * 会员订单
 *--------------------------------------
 * @project		: uwa
 * @author		: cblee
 * @created		: 2012-11-16
 * @copyright	: (c)2012 AsThis
 *--------------------------------------
 */

class MemberOrderModl extends Modl
{
	public function get_orderList($where, $order, $limit)
	{
		$_OL = $this->where($where)->order($order)->limit($limit)->select();
		return $_OL;
	}

	public function delete_order($memberOrderId)
	{
		$result = array('data' => '', 'error' => '');

		if(false === $this->delete($memberOrderId))
		{
			$result['error'] = L('DELETE_FAILED');
			return $result;
		}

		return $result;
	}

	public function pay_order($memberOrderId)
	{
		$result = array('data' => '', 'error' => '');

		if(false === $this->where('member_order_id = \''.$memberOrderId.'\'')->set_field('o_status', 1))
		{
			$result['error'] = L('PAY_FAILED');
			return $result;
		}

		return $result;

	}

}

?>