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