AHeadFoot.php 1.1 KB
<?php

namespace App\Models\Template;

/**
 * 头部底部
 * @author:dc
 * @time 2023/5/4 15:52
 * Class AHeadFoot
 * @package App\Models\Template
 */
class AHeadFoot extends \App\Models\Base{

    protected $table = 'gl_aside_template_header_footer';

//    分开存 头底 为了方便后期可能会 改版为 随意搭配 头底部
    const TYPE_HEADER   =   'H';
    const TYPE_FOOTER   =   'F';

    const STATUS_ACTIVE = 1;
    const STATUS_DISABLED = 0;

    const IS_DEFAULT = 1;


    /**
     * b 端 查询
     * @return mixed
     * @author:dc
     * @time 2023/5/4 16:24
     */
    public static function _ball(){
        return static::where('status',static::STATUS_ACTIVE)->orderBy('sort')->get(['id','name','type','html','is_default']);
    }

    /**
     * b 端 读取默认的一个头部底部
     * @return mixed
     * @author:dc
     * @time 2023/5/4 16:51
     */
    public static function _bDefault(){
        return static::where(['status'=>static::STATUS_ACTIVE,'is_default'=>static::IS_DEFAULT])
            ->get(['type','html'])
            ->pluck('html','type')
            ->toArray();
    }




}