feat: spu

This commit is contained in:
2025-01-21 10:28:40 +08:00
parent 8e454659e1
commit df78fc705d
5 changed files with 63 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace App\Model;
use Hyperf\DbConnection\Model\Model;
use Hyperf\Tappable\HigherOrderTapProxy;
/**
* @property int $id
@@ -34,4 +35,13 @@ class Category extends Model
const string UPDATED_AT = 'update_time';
/**
* @param int $id
* @return HigherOrderTapProxy|mixed|null
*/
public function getNameById(int $id): mixed
{
return $this->where('id', $id)->value('name');
}
}