<?php

namespace app\api\controller;

use app\api\validate\OrderReportValidate;
use app\api\logic\OrderReportLogic;
use app\common\model\dict\DictData;

class OrderReportController extends BaseApiController
{
    public function ReportList()
    {
        return $this->data(DictData::where(['type_value'=>'order_report','status'=>1])->field('value,name')->select()->toArray());
    }

    public function add()
    {
        $params = (new OrderReportValidate())->post()->goCheck('add',[
            'user_id' => $this->userId,
        ]);
        $result = OrderReportLogic::add($params);
        if (true === $result) {
            return $this->success('已提交投诉审核', [], 1, 1);
        }
        return $this->fail(OrderReportLogic::getError());
    }
}