<?php

namespace app\api\controller\Works;

use app\BaseController;
use app\common\model\Works\WorksType as ModelWorksType;
use app\Request;
use think\Validate;
use think\exception\ValidateException;
use think\facade\Filesystem;
use app\common\arw\adjfut\src\Excel;
use app\common\arw\adjfut\src\Traverse;
use app\common\arw\adjfut\src\UploadFile;
use app\common\exception\Tool;
use think\facade\Db;
use think\facade\Env;


class WorksType extends BaseController
{
    /**
     * 获取作品类型列表接口
     *
     * @param Request request
     * @return array
     * @date 2023-04-17
     * @author xjh
     * @since 1.0.0
     */
    public function getWorksTypeList(Request $request): array
    {
        $select =  ModelWorksType::field(['works_type_name' => 'name', 'works_type_id'])
            ->where('works_type_parent_guid', "0")
            ->order('works_type_order')
            ->select();

        return msg(0, "获取作品类型列表成功!", [
            'data' => $select,
            'count' => count($select)
        ]);
    }
}
