<?php

namespace app\common\model\school\activity\order;

use app\common\model\BaseModel;
use think\Model;

class Detail extends BaseModel
{
    // 表名
    protected $name = 'school_activity_order_detail';


    public function getImagesAttr($value, $data)
    {
        $imagesArray = [];
        if (!empty($value)) {
            $imagesArray = explode(',', $value);
            foreach ($imagesArray as &$v) {
                $v = cdnurl($v, true);
            }
            return $imagesArray;
        }
        return $imagesArray;
    }




    public function setImagesAttr($value, $data)
    {
        $imagesArray = $value;
        if (!empty($value) && is_array($value)) {
            //转成逗号拼接字符串
            $imagesArray = implode(',', $value);
        }
        return $imagesArray;
    }


}
