add shipping rules
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\ArticleNature;
|
||||
use App\Models\Shop\Article;
|
||||
use App\Models\Botanic\Specie;
|
||||
use App\Models\Botanic\Variety;
|
||||
use App\Models\Shop\Article;
|
||||
use App\Models\Shop\ArticleNature;
|
||||
use App\Models\Shop\Merchandise;
|
||||
|
||||
class ArticleNatures
|
||||
@@ -18,6 +18,7 @@ class ArticleNatures
|
||||
public static function getProductType($id)
|
||||
{
|
||||
$type = self::get($id)->product_type ?? false;
|
||||
|
||||
return $type ? self::getProductTypes()[$type] : false;
|
||||
}
|
||||
|
||||
@@ -40,6 +41,7 @@ class ArticleNatures
|
||||
case Merchandise::class:
|
||||
return 2;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -61,6 +63,7 @@ class ArticleNatures
|
||||
public static function getOptionsByProductTypeModel($model)
|
||||
{
|
||||
$type = self::getProductTypeByModel($model);
|
||||
|
||||
return self::getOptionsByProductType($type);
|
||||
}
|
||||
|
||||
@@ -87,6 +90,7 @@ class ArticleNatures
|
||||
public static function getNamesByIds($ids)
|
||||
{
|
||||
$names = ArticleNature::byIds($ids)->pluck('name')->toArray();
|
||||
|
||||
return array_map('strtolower', $names);
|
||||
}
|
||||
|
||||
@@ -98,6 +102,7 @@ class ArticleNatures
|
||||
public static function store($data)
|
||||
{
|
||||
$item = ($data['id'] ?? false) ? self::update($data) : self::create($data);
|
||||
|
||||
return $item->id;
|
||||
}
|
||||
|
||||
@@ -111,6 +116,7 @@ class ArticleNatures
|
||||
$id = $id ? $id : $data['id'];
|
||||
$item = self::get($id);
|
||||
$ret = $item->update($data);
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user