<?php

namespace Modules\User\Models\Traits;

use Illuminate\Database\Eloquent\Builder;
use Modules\User\Models\Identity;

trait HasIdentityScopes
{

    /**
     * Notes: 体验官
     *
     * @Author: 玄尘
     * @Date: 2022/8/18 15:25
     * @param  Builder  $query
     * @return Builder
     */
    public function scopeTy(Builder $query): Builder
    {
        return $query->where('job', Identity::JOB_TY);
    }

    /**
     * Notes: 季卡
     *
     * @Author: 玄尘
     * @Date: 2022/8/18 15:26
     * @param  Builder  $query
     * @return Builder
     */
    public function scopeJk(Builder $query): Builder
    {
        return $query->where('job', Identity::JOB_JK);
    }

    /**
     * Notes: 年卡
     *
     * @Author: 玄尘
     * @Date: 2022/8/18 15:27
     * @param  Builder  $query
     * @return Builder
     */
    public function scopeNk(Builder $query): Builder
    {
        return $query->where('job', Identity::JOB_NK);
    }

    /**
     * Notes: 创始
     *
     * @Author: 玄尘
     * @Date: 2022/8/18 15:27
     * @param  Builder  $query
     * @return Builder
     */
    public function scopeCs(Builder $query): Builder
    {
        return $query->where('job', Identity::JOB_CS);
    }

    /**
     * Notes: 合伙人
     *
     * @Author: 玄尘
     * @Date: 2022/8/18 15:27
     * @param  Builder  $query
     * @return Builder
     */
    public function scopeHh(Builder $query): Builder
    {
        return $query->where('job', Identity::JOB_HH);
    }


}
