Base.php 754 字节
<?php

namespace Controller;


use Model\emailSql;

/**
 * 基础控制器,根据需求 可以不继承此类
 * @author:dc
 * @time 2023/2/18 16:34
 * Class Base
 * @package Controller
 */
abstract class Base {


    /**
     * @param string $filed
     * @return mixed|null
     * @throws \Lib\Err
     * @author:dc
     * @time 2023/3/10 15:15
     */
    protected final function getEmails($filed='*'){
        static $data;
        if(empty($data)){
            $data = db()->all(emailSql::all(web_request_emails()));
            if(empty($data)){
                app()->e('email_request_required');
            }
        }

        if($filed == '*'){
            return $data;
        }

        return array_column($data,$filed);

    }



}