fix devops error
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Core\App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Application extends Model
|
||||
{
|
||||
protected $connection = 'system';
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public function pages()
|
||||
{
|
||||
return $this->hasMany(\App\Models\Core\App\ApplicationPage::class);
|
||||
}
|
||||
|
||||
public function modules()
|
||||
{
|
||||
return $this->hasMany(\App\Models\Core\App\ApplicationModule::class);
|
||||
}
|
||||
|
||||
public function scopeActive($query)
|
||||
{
|
||||
return $query->where('active', 1);
|
||||
}
|
||||
|
||||
public function scopeVisible($query)
|
||||
{
|
||||
return $query->where('visible', 1);
|
||||
}
|
||||
|
||||
public function scopeBySlug($query, $slug)
|
||||
{
|
||||
return $query->where('slug', $slug);
|
||||
}
|
||||
|
||||
public function scopeByOrder($query)
|
||||
{
|
||||
return $query->sortBy('order');
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Core\App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ApplicationClient extends Model
|
||||
{
|
||||
protected $connection = 'system';
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
protected $table = 'application_clients';
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public function application()
|
||||
{
|
||||
return $this->belongsTo(\App\Models\Core\App\Application::class);
|
||||
}
|
||||
|
||||
public function client()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Partner\Client');
|
||||
}
|
||||
|
||||
public function scopeActive($query)
|
||||
{
|
||||
return $query->where('active', 1);
|
||||
}
|
||||
|
||||
public function scopeByApplication($query, $id)
|
||||
{
|
||||
return $query->where('application_id', $id);
|
||||
}
|
||||
|
||||
public function scopeByClient($query, $id)
|
||||
{
|
||||
return $query->where('client_id', $id);
|
||||
}
|
||||
|
||||
public function scopeBySlug($query, $slug)
|
||||
{
|
||||
return $query->whereHas('application', function ($query) use ($slug) {
|
||||
$query->bySlug($slug);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Core\App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ApplicationModule extends Model
|
||||
{
|
||||
protected $connection = 'system';
|
||||
|
||||
protected $table = 'application_modules';
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public function application()
|
||||
{
|
||||
return $this->belongsTo(\App\Models\Core\App\Application::class);
|
||||
}
|
||||
|
||||
public function permissions()
|
||||
{
|
||||
return $this->hasMany(\App\Models\Core\Auth\Permission::class);
|
||||
}
|
||||
|
||||
public function scopeActive($query)
|
||||
{
|
||||
return $query->where('active', 1);
|
||||
}
|
||||
|
||||
public function scopeByApplication($query, $id)
|
||||
{
|
||||
return $query->where('application_id', $id);
|
||||
}
|
||||
|
||||
public function scopeBySlug($query, $slug)
|
||||
{
|
||||
return $query->where('slug', $slug);
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Core\App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ApplicationPage extends Model
|
||||
{
|
||||
protected $connection = 'system';
|
||||
|
||||
protected $table = 'application_pages';
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public function application()
|
||||
{
|
||||
return $this->belongsTo(\App\Models\Core\App\Application::class);
|
||||
}
|
||||
|
||||
public function scopeActive($query)
|
||||
{
|
||||
return $query->where('active', 1);
|
||||
}
|
||||
|
||||
public function scopeByApplication($query, $application_id)
|
||||
{
|
||||
return $query->where('application_id', $application_id);
|
||||
}
|
||||
|
||||
public function scopeBySlug($query, $slug)
|
||||
{
|
||||
return $query->where('slug', $slug);
|
||||
}
|
||||
}
|
||||
@@ -9,13 +9,13 @@ class Team extends LaratrustTeam
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $connection = 'mysql';
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $connection = 'mysql';
|
||||
|
||||
public function users()
|
||||
{
|
||||
return $this->hasMany(\App\Models\Core\Auth\User::class);
|
||||
return $this->hasMany(User::class);
|
||||
}
|
||||
|
||||
public function scopeActive($query)
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Core\Auth;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class UserClient extends Model
|
||||
{
|
||||
protected $connection = 'system';
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public function client()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Partner\Client');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\User');
|
||||
}
|
||||
|
||||
public function scopeByClient($query, $id)
|
||||
{
|
||||
return $query->where('client_id', $id);
|
||||
}
|
||||
|
||||
public function scopeByUser($query, $id)
|
||||
{
|
||||
return $query->where('user_id', $id);
|
||||
}
|
||||
}
|
||||
@@ -6,14 +6,14 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class UserStatus extends Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
protected $table = 'user_statuses';
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public function scopeByName($query, $name)
|
||||
{
|
||||
return $query->where('name', $name);
|
||||
|
||||
@@ -6,22 +6,22 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class UserStatusTeam extends Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
protected $table = 'user_status_teams';
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public function user_status()
|
||||
{
|
||||
return $this->belongsTo(\App\Models\Core\Auth\UserStatus::class);
|
||||
return $this->belongsTo(UserStatus::class);
|
||||
}
|
||||
|
||||
public function team()
|
||||
{
|
||||
return $this->belongsTo(\App\Models\Core\Auth\Team::class);
|
||||
return $this->belongsTo(Team::class);
|
||||
}
|
||||
|
||||
public function scopeByUserStatus($query, $id)
|
||||
|
||||
@@ -16,12 +16,12 @@ class Category extends parentCategory
|
||||
{
|
||||
use CascadeDelete, SoftDeletes, Taggable, Userstamps;
|
||||
|
||||
public $translatable = [];
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
protected $table = 'categories';
|
||||
|
||||
public $translatable = [];
|
||||
|
||||
protected $cascadeDeleteMorph = ['Articles'];
|
||||
|
||||
protected $fillable = [
|
||||
|
||||
@@ -50,9 +50,7 @@ class Customer extends Authenticatable
|
||||
|
||||
public function deliveries()
|
||||
{
|
||||
return $this->hasManyDeepFromRelations(
|
||||
$this->sale_channels(),
|
||||
(new SaleChannel())->deliveries())
|
||||
return $this->hasManyDeepFromRelations($this->sale_channels(), (new SaleChannel())->deliveries())
|
||||
->whereNull('shop_customer_sale_channels.deleted_at');
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,11 @@ class PriceListValue extends Model
|
||||
|
||||
public function tariff()
|
||||
{
|
||||
return $this->belongsToThrough(Tariff::class, PriceList::class, null, '',
|
||||
return $this->belongsToThrough(
|
||||
Tariff::class,
|
||||
PriceList::class,
|
||||
null,
|
||||
'',
|
||||
[
|
||||
'App\Models\Shop\Tariff' => 'tariff_id',
|
||||
'App\Models\Shop\PriceList' => 'price_list_id',
|
||||
|
||||
@@ -8,6 +8,8 @@ use Rinvex\Tags\Models\Tag as parentTag;
|
||||
|
||||
class Tag extends parentTag
|
||||
{
|
||||
public $translatable = [];
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
protected $fillable = [
|
||||
@@ -19,8 +21,6 @@ class Tag extends parentTag
|
||||
'tag_group_id',
|
||||
];
|
||||
|
||||
public $translatable = [];
|
||||
|
||||
// TODO
|
||||
public function offers()
|
||||
{
|
||||
@@ -69,9 +69,11 @@ class Tag extends parentTag
|
||||
|
||||
public function scopeWithCountArticlesByCategory($query, $category_id)
|
||||
{
|
||||
return $query->withCount(['articles' => function ($query) use ($category_id) {
|
||||
$query->byCategoryParent($category_id);
|
||||
}]);
|
||||
return $query->withCount([
|
||||
'articles' => function ($query) use ($category_id) {
|
||||
$query->byCategoryParent($category_id);
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
public function scopeById($query, $id)
|
||||
|
||||
Reference in New Issue
Block a user