39 lines
1.4 KiB
PHP
39 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Modules\Seller\Entities;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Modules\Seller\Entities\DomainModel;
|
|
|
|
class SitesModel extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'tbl_digital_website';
|
|
protected $fillable = [
|
|
'id', 'user_id', 'url', 'description', 'is_role', 'is_type', 'is_language', 'is_post_price', 'is_url_category',
|
|
'is_delivery_time', 'is_content_included', 'is_content_price', 'is_word_limit', 'is_post_sample', 'is_page_authority',
|
|
'is_domain_authority', 'is_status', 'is_premium', 'created_at', 'updated_at', 'is_type_product', 'is_temporary_url'
|
|
];
|
|
protected $hidden = [
|
|
'created_at', 'updated_at',
|
|
];
|
|
|
|
protected $keyType = 'string';
|
|
public $incrementing = false;
|
|
|
|
public function user()
|
|
{
|
|
return $this->hasMany(AccountModel::class, 'id', 'user_id');
|
|
}
|
|
|
|
public static function getAllProduct()
|
|
{
|
|
$websites = self::where('is_status', 1)->select('id', 'url', 'is_post_price as price', 'is_delivery_time', 'is_type_product')->paginate($this->perPage)->get();
|
|
$domain = DomainModel::where('is_status', 1)->select('id', 'url', 'is_price as price', 'is_delivery_time', 'is_type_product')->paginate($this->perPage)->get();
|
|
|
|
return $websites->merge($domain);
|
|
}
|
|
}
|