feat: spu
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user