feat:chef

This commit is contained in:
LAPTOP-7SGDREK0\shiweijun
2025-01-08 17:52:29 +08:00
parent ce9d16eeda
commit 804d65b725
6 changed files with 67 additions and 68 deletions

View File

@@ -4,13 +4,12 @@ declare(strict_types=1);
namespace App\Model;
use App\Constants\Admin\UserCode;
use Hyperf\Database\Model\Builder;
use Hyperf\DbConnection\Model\Model;
/**
* @property int $id
* @property string $name
* @property int $avatar_id
* @property int $id
* @property int $user_id
* @property string $profile
* @property string $specialties
@@ -33,7 +32,7 @@ class Chef extends Model
/**
* The attributes that should be cast to native types.
*/
protected array $casts = ['id' => 'integer', 'avatar_id' => 'integer', 'user_id' => 'integer', 'is_del' => 'integer'];
protected array $casts = ['id' => 'integer', 'user_id' => 'integer', 'is_del' => 'integer'];
const string CREATED_AT = 'create_time';
@@ -54,7 +53,7 @@ class Chef extends Model
*/
public function getInfoByUserId(int $userId): \Hyperf\Database\Model\Model|Builder|null
{
return $this->where('user_id', $userId)->first();
return $this->where('is_del',UserCode::IS_NO_DEL)->where('user_id', $userId)->first();
}
}