39 lines
721 B
PHP
Executable File
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;
|
|
}
|
|
|
|
}
|