工单列表
This commit is contained in:
@@ -14,7 +14,7 @@ use support\Model;
|
||||
* @property string $updated_at 更新时间
|
||||
* @property string $deleted_at 删除时间
|
||||
*/
|
||||
class TicketCategorie extends Model
|
||||
class Categorie extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
protected $connection = 'mysql';
|
||||
@@ -37,7 +37,7 @@ class TicketCategorie extends Model
|
||||
*/
|
||||
public function translation()
|
||||
{
|
||||
return $this->hasOne(TicketCategorieTranslation::class, 'categorie_id')->where('locale', locale());
|
||||
return $this->hasOne(CategorieTranslation::class, 'categorie_id')->where('locale', locale());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,6 +45,10 @@ class TicketCategorie extends Model
|
||||
*/
|
||||
public function translations()
|
||||
{
|
||||
return $this->hasMany(TicketCategorieTranslation::class, 'categorie_id');
|
||||
return $this->hasMany(CategorieTranslation::class, 'categorie_id');
|
||||
}
|
||||
|
||||
public function ticket(){
|
||||
return $this->hasOne(Ticket::class, 'categorie_id', 'id');
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -14,7 +14,7 @@ use support\Model;
|
||||
* @property string $created_at 创建时间
|
||||
* @property string $updated_at 更新时间
|
||||
*/
|
||||
class TicketCategorieTranslation extends Model
|
||||
class CategorieTranslation extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
protected $table = 'ticket_categorie_translation';
|
||||
@@ -70,4 +70,8 @@ class Ticket extends Model
|
||||
public function attachments(){
|
||||
return $this->hasMany(Attachment::class, 'ticket_id', 'id');
|
||||
}
|
||||
|
||||
public function categorie(){
|
||||
return $this->belongsTo(Categorie::class, 'categorie_id', 'id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user