<?php

namespace App\Models;

use App\Models\traits\SetConnection;
use Illuminate\Support\Facades\Auth;
use Illuminate\Database\Eloquent\Model;

class RelationPortalStatusPublic extends Model
{
    use SetConnection;

    protected $fillable = [
        'store_id', 'net_frame_from', 'net_frame_to', 'net_report_from', 'net_report_to', 'type'
    ];

    const CREATED_AT = null;
    const UPDATED_AT = null;

    public static function getArticleTotal($type, $store_id)
    {
        $query = RelationPortalStatusPublic::query();

        $query->where('type', '=', $type)->where('store_id', '=', $store_id);
        if($query->count() == 0){
            return false;
        }
        return $query->first();
    }
}
