<?php

namespace Modules\Project\Extensions;
use Encore\Admin\Admin;
use Encore\Admin\Grid\Displayers\AbstractDisplayer;
use Modules\Project\Entities\Order;

class OrderStatus extends AbstractDisplayer
{
    public function display($placement = 'left')
    {
        $status = $this->value;

        /*
        switch ($status) {
            case Order::STATUS_DEFAULT:
                return '待支付';
                break;
            case Order::STATUS_CANCEL:
                return '已取消';
                break;
            case Order::STATUS_PAID:
                $fahuo = "<a href='' class='btn btn-xs btn-twitter' role='button'>去发货</a>";

                return "已支付 {$fahuo}";
                break;
            case Order::STATUS_SHIPPED:
                $fahuo = "<a href='' class='btn btn-xs btn-twitter' role='button'>修改发货信息</a>";

                return "已发货 {$fahuo}";
                break;
        }
        */

        $path = __DIR__.'/../Resources/views/admin/order_status.blade.php';

        return view()->file($path, ['status'=>$status,'row'=>$this->row,'address'=>$this->row->address])->render();

    }
}