海南旅游SAAS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

25 lines
527 B

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class AgentSetting extends BaseModel
{
use HasFactory;
protected $fillable = ['agent_id', 'setting'];
protected $casts = ['setting' => 'json'];
public function __construct(array $attributes = [])
{
parent::__construct($attributes);
$this->timestamps = false;
}
public static function val($agent_id, $key)
{
$setting = static::query()->where('agent_id', $agent_id)->value('setting');
return $setting[$key] ?? null;
}
}