DeployBuild.php
895 字节
<?php
namespace App\Models\Project;
use App\Helper\Arr;
use App\Models\Base;
use Hashids\Hashids;
use Illuminate\Support\Facades\Cache;
class DeployBuild extends Base
{
//设置关联表名
protected $table = 'gl_project_deploy_build';
public function setPlanAttribute($value){
$this->attributes['plan'] = Arr::arrToSet($value, 'trim');
}
public function getPlanAttribute($value){
return Arr::setToArr($value, 'trim');
}
// public function getTestDomainAttribute(): string
// {
// $hashids = new Hashids('test_domain', 5, 'abcdefghjkmnpqrstuvwxyz1234567890');
// $code = $hashids->encode($this->project_id);
// return 'https://v6-' . $code . '.globalso.site';
// }
public static function clearCache($row){
$cache_key = 'project_' . $row->original['test_domain'];
Cache::forget($cache_key);
}
}