mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 02:39:10 -04:00
Fix Bug#100
This commit is contained in:
12
app/Item.php
12
app/Item.php
@@ -3,6 +3,7 @@
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use mysql_xdevapi\Collection;
|
||||
|
||||
class Item extends Model
|
||||
{
|
||||
@@ -29,6 +30,17 @@ class Item extends Model
|
||||
|
||||
public function category()
|
||||
{
|
||||
if (\App\ItemCategory::find($this->category_id) == null)
|
||||
{
|
||||
$this->category_id = -1;
|
||||
$this->save();
|
||||
$c = new \App\ItemCategory();
|
||||
$c->name = "[Categorie Supprimé]";
|
||||
$c->is_training = 0;
|
||||
$c->is_op_appro = 0;
|
||||
|
||||
return $c;
|
||||
}
|
||||
return \App\ItemCategory::find($this->category_id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user