<?php

namespace app\api\controller\{$moduleName};

use app\BaseController;
use app\common\model\{$moduleName}\{$className} as Model{$className};
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\UploadFile;
use think\facade\Db;
use app\common\exception\Tool;
use think\facade\Env;


class {$className} extends BaseController
{
    /**
     * 获取{$functionName}列表
     */
    public function get{$className}List(Request $request): array
    {
        $params = $request->param();
        $con = [];

        {$whereContent}

        $query = Model{$className}::where($con)
            ->field({$queryFields})
            ->order('{$orderField}', '{$orderMode}')
            ->select();

        return msg(0, "获取{$functionName}列表成功!", [
            'data' => $query,
            'count' => count($query)
        ]);
    }

    /**
     * 获取{$functionName}详情
     */
    public function get{$className}Info(Request $request): array
    {
        $params = $request->param();

        $this->validate($params, ['{$businessName}_guid' => 'require']);

        $find = Model{$className}::field({$queryFields})
                ->where('{$businessName}_guid',$params['{$businessName}_guid'])
                ->find();

        return msg(0,'获取{$functionName}详情成功!',['data' => $find]);
    }

}
