<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace app\model\operate;

use app\model\BaseModel;
use think\model\concern\SoftDelete;
use think\facade\Cache;

class Ads extends BaseModel{

	protected function getStatusTextAttr($value, $data){
		$status = ['禁用', '启用'];
		return isset($status[$data['status']]) ? $status[$data['status']] : '';
	}

	public function getPhotoAttr($value, $data){
		if($data['photo_list']){
			if($data['type'] == 1){
				return explode(",", $data['photo_list']);
			}else{
				return $data['photo_list'];
			}
		}else{
			if($data['type'] == 1){
				return [];
			}else{
				return '';
			}
		}
	}
}