dd/app/Models/NoteOption.php
2025-05-10 13:33:39 +08:00

39 lines
721 B
PHP
Executable File

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class NoteOption extends Model
{
protected $table = 'note_option';
public $timestamps = false;
public static function _find($sKey)
{
$aData = self::where("key", $sKey)->first()->toArray();
if ($aData["value"]) {
$r = $aData["value"];
} else {
$r = false;
}
return $r;
}
public static function _all()
{
$aData = self::all()->toArray();
$aDataNew = [];
foreach ($aData as $row) {
$aDataNew[$row["key"]] = $row["value"];
}
return $aDataNew;
}
}