<?php namespace Place\Api;
use Dever;
use Place;
use Place\Lib\Main;
class Test extends Main
{
    protected $login = true;
    protected $entry = true;
    # 将订单设置为成功
    public function order()
    {
        $app = Dever::input('app', 'is_string', '资源类型', 'goods');
        $status = Dever::input('status', 'is_numeric', '订单状态', '1');
        $order_num = Dever::input('order_num', 'is_string', '订单号');
        Dever::load('order', $app)->success($order_num, $status);
        return 'ok';
    }

    public function yue_commit(){}
    public function yue()
    {
        $state = Dever::db('member', 'place')->update(Place::$uid, array('cash' => -10));
        $info = Dever::db('member', 'place')->find(Place::$uid);
        $info['yue'] = $info['cash'];
        if ($info['yue'] < 0) {
            Dever::error('余额不足');
        }

        print_r($state);die;
    }
}