no message
This commit is contained in:
commit
ea84bca5e0
93 files changed
+15373
No files matched your search
Executable
+43
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class DogOption extends Model
|
||||
{
|
||||
protected $table = 'dog_option';
|
||||
public $timestamps = false;
|
||||
|
||||
public static function _hit($sDogName, $k)
|
||||
{
|
||||
$v = self::where("dog_name", $sDogName)->where("k", $k)->first()?->v;
|
||||
return $v;
|
||||
}
|
||||
|
||||
public static function _list($sDogName)
|
||||
{
|
||||
$oSelf = self::where("dog_name", $sDogName)->get();
|
||||
|
||||
return self::_filterList($oSelf);
|
||||
}
|
||||
|
||||
public static function _filter($oOption)
|
||||
{
|
||||
$arr = [];
|
||||
$arr[$oOption->dog_name."#".$oOption->k] = $oOption->v;
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
public static function _filterList($oOption)
|
||||
{
|
||||
$arr = [];
|
||||
foreach ($oOption as $oOptionRow) {
|
||||
$arr[] = self::_filter($oOptionRow);
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user