Banner.php 497 字节
<?php

namespace app\common\model;

use think\Model;

class Banner extends Model
{
    public function getBannerImageAttr($value, $data)
    {
        return !empty($value) ? cdnurl($value,true) : '';
    }

    /**
     * 轮播列表
     */
    public static function banner_list()
    {
        $list = Banner::order('weigh desc')->select();
        foreach($list as $v){
        	$v->visible(['id','banner_image','banner_url']);
        }
        return collection($list)->toArray();
    }
}